Laravel event when the publishing date is came

1.2k views Asked by At

I'm using Laravel but I searched for the appropriate way to do ..

We write articles in our website and give them a publishing date.

Those articles won't display in our website before the publishing date.

Is there any way by using Laravel or another way, to do something immediately after the publishing is done, ex. sending an email

1

There are 1 answers

2
Jerodev On BEST ANSWER

You can send a job to your queue and delay it until the post is published.

https://laravel.com/docs/5.7/queues#delayed-dispatching



Edited example from documentation:

ProcessPodcast::dispatch($podcast)->delay($article->published_at);