Build Laravel 13 ticket assistant with Docker, Livewire admin, and helpdesk scraper command
This commit is contained in:
21
app/Services/AdminArticleService.php
Normal file
21
app/Services/AdminArticleService.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Article;
|
||||
|
||||
class AdminArticleService
|
||||
{
|
||||
public function paginate(int $perPage = 10)
|
||||
{
|
||||
return Article::query()->latest()->paginate($perPage);
|
||||
}
|
||||
|
||||
public function create(string $title, string $content): Article
|
||||
{
|
||||
return Article::query()->create([
|
||||
'title' => trim($title),
|
||||
'content' => trim($content),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user