lundi 8 février 2021

Laravel Job - creating fail conditions in a dispatch closure

I am creating some emails for my site to send out using the job system. Instead of dispatching a job class to the queue, I'm dispatching a closure.

dispatch(function() use ($var1, $var2, $var3)){
    ...
}

I need to add some failure conditions (files can't be found, etc.). What is the best way to do this? Return false? Create an exception?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3oXWpC1
via IFTTT

Aucun commentaire:

Enregistrer un commentaire