@@ -16,9 +16,9 @@ final class CreateArticleAction
16
16
{
17
17
public function execute (CreateArticleData $ articleData ): Article
18
18
{
19
- if ($ articleData ->published_at && ! ($ articleData ->published_at instanceof DateTimeInterface)) {
20
- $ articleData ->published_at = new Carbon (
21
- time: $ articleData ->published_at ,
19
+ if ($ articleData ->publishedAt && ! ($ articleData ->publishedAt instanceof DateTimeInterface)) {
20
+ $ articleData ->publishedAt = new Carbon (
21
+ time: $ articleData ->publishedAt ,
22
22
tz: config ('app.timezone ' )
23
23
);
24
24
}
@@ -28,26 +28,26 @@ public function execute(CreateArticleData $articleData): Article
28
28
'title ' => $ articleData ->title ,
29
29
'slug ' => $ articleData ->title ,
30
30
'body ' => $ articleData ->body ,
31
- 'published_at ' => $ articleData ->published_at ,
32
- 'submitted_at ' => $ articleData ->submitted_at ,
33
- 'approved_at ' => $ articleData ->approved_at ,
34
- 'show_toc ' => $ articleData ->show_toc ,
35
- 'canonical_url ' => $ articleData ->canonical_url ,
31
+ 'published_at ' => $ articleData ->publishedAt ,
32
+ 'submitted_at ' => $ articleData ->submittedAt ,
33
+ 'approved_at ' => $ articleData ->approvedAt ,
34
+ 'show_toc ' => $ articleData ->showToc ,
35
+ 'canonical_url ' => $ articleData ->canonicalUrl ,
36
36
'user_id ' => Auth::id (),
37
37
]);
38
38
39
- if (collect ($ article -> associateTags )->isNotEmpty ()) {
40
- $ article ->syncTags (tags: $ article -> associateTags );
39
+ if (collect ($ articleData -> tags )->isNotEmpty ()) {
40
+ $ article ->syncTags (tags: $ articleData -> tags );
41
41
}
42
42
43
- if ($ article ->file ) {
44
- $ article ->addMedia ($ article ->file ->getRealPath ())->toMediaCollection ('media ' );
43
+ if ($ articleData ->file ) {
44
+ $ article ->addMedia ($ articleData ->file ->getRealPath ())->toMediaCollection ('media ' );
45
45
}
46
46
47
47
if ($ article ->isAwaitingApproval ()) {
48
48
// Envoi de la notification sur le channel Telegram pour la validation de l'article.
49
49
Auth::user ()?->notify(new PostArticleToTelegram ($ article ));
50
- session ()->flash ('status ' , __ ('Merci d \' avoir soumis votre article. Vous aurez des nouvelles que lorsque nous accepterons votre article. ' ));
50
+ session ()->flash ('status ' , __ ('notifications. article.created ' ));
51
51
}
52
52
53
53
if (Auth::user ()?->hasAnyRole(['admin ' , 'moderator ' ])) {
0 commit comments