File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
app/Http/Livewire/Articles Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class Create extends Component
20
20
21
21
protected $ listeners = ['markdown-x:update ' => 'onMarkdownUpdate ' ];
22
22
23
- public function mount ()
23
+ public function mount (): void
24
24
{
25
25
/** @var User $user */
26
26
$ user = Auth::user ();
@@ -30,13 +30,13 @@ public function mount()
30
30
$ this ->approved_at = $ user ->hasAnyRole (['admin ' , 'moderator ' ]) ? now () : null ;
31
31
}
32
32
33
- public function submit ()
33
+ public function submit (): void
34
34
{
35
35
$ this ->submitted_at = now ();
36
36
$ this ->store ();
37
37
}
38
38
39
- public function store ()
39
+ public function store (): void
40
40
{
41
41
$ this ->validate ();
42
42
@@ -65,8 +65,10 @@ public function store()
65
65
}
66
66
67
67
if ($ article ->isAwaitingApproval ()) {
68
- // Envoi de la notification sur le channel Telegram pour la validation de l'article.
69
- event (new ArticleWasSubmittedForApproval ($ article ));
68
+ if (app ()->environment ('production ' )) {
69
+ // Envoi de la notification sur le channel Telegram pour la validation de l'article.
70
+ event (new ArticleWasSubmittedForApproval ($ article ));
71
+ }
70
72
71
73
session ()->flash ('status ' , 'Merci d \'avoir soumis votre article. Vous aurez des nouvelles que lorsque nous accepterons votre article. ' );
72
74
}
You can’t perform that action at this time.
0 commit comments