@@ -16,9 +16,9 @@ final class CreateArticleAction
1616{
1717 public function execute (CreateArticleData $ articleData ): Article
1818 {
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 ,
2222 tz: config ('app.timezone ' )
2323 );
2424 }
@@ -28,26 +28,26 @@ public function execute(CreateArticleData $articleData): Article
2828 'title ' => $ articleData ->title ,
2929 'slug ' => $ articleData ->title ,
3030 '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 ,
3636 'user_id ' => Auth::id (),
3737 ]);
3838
39- if (collect ($ article -> associateTags )->isNotEmpty ()) {
40- $ article ->syncTags (tags: $ article -> associateTags );
39+ if (collect ($ articleData -> tags )->isNotEmpty ()) {
40+ $ article ->syncTags (tags: $ articleData -> tags );
4141 }
4242
43- if ($ article ->file ) {
44- $ article ->addMedia ($ article ->file ->getRealPath ())->toMediaCollection ('media ' );
43+ if ($ articleData ->file ) {
44+ $ article ->addMedia ($ articleData ->file ->getRealPath ())->toMediaCollection ('media ' );
4545 }
4646
4747 if ($ article ->isAwaitingApproval ()) {
4848 // Envoi de la notification sur le channel Telegram pour la validation de l'article.
4949 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 ' ));
5151 }
5252
5353 if (Auth::user ()?->hasAnyRole(['admin ' , 'moderator ' ])) {
0 commit comments