jonnybarnes.uk/app/Services/ArticleService.php

20 lines
416 B
PHP
Raw Normal View History

<?php
declare(strict_types=1);
namespace App\Services;
use App\Models\Article;
class ArticleService extends Service
{
2023-12-06 20:11:41 +00:00
public function create(array $request, ?string $client = null): Article
{
return Article::create([
'title' => $this->getDataByKey($request, 'name'),
'main' => $this->getDataByKey($request, 'content'),
'published' => true,
]);
}
}