Allow micropub to post notes and articles
This commit is contained in:
parent
5eed665801
commit
ca6205d2a6
9 changed files with 102 additions and 49 deletions
19
app/Services/ArticleService.php
Normal file
19
app/Services/ArticleService.php
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Article;
|
||||
|
||||
class ArticleService extends Service
|
||||
{
|
||||
public function create(array $request, ?string $client = null): Article
|
||||
{
|
||||
return Article::create([
|
||||
'title' => $this->getDataByKey($request, 'name'),
|
||||
'main' => $this->getDataByKey($request, 'content'),
|
||||
'published' => true,
|
||||
]);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue