You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering around your Handbook to see if any rule would help me improve my code and in the section 'Dispatching' of the Laravel Handbook it says that using this way of dispatching jobs is bad:
// BAD
YouJob::dispatch($argument); // \Illuminate\Foundation\Bus\Dispatchable trait
Because it uses the Dispatchable trait, and that it works differently than the dispatch() helper, but that's wrong, this trait creates a PendingDispatch object the same way dispatch() does. I've used this trait pretty much always so I would like to know if I'm wrong as I think the only bad option is using the Bus Facade.
Thanks a lot!
The text was updated successfully, but these errors were encountered:
I was wondering around your Handbook to see if any rule would help me improve my code and in the section 'Dispatching' of the Laravel Handbook it says that using this way of dispatching jobs is bad:
Because it uses the
Dispatchable
trait, and that it works differently than thedispatch()
helper, but that's wrong, this trait creates a PendingDispatch object the same waydispatch()
does. I've used this trait pretty much always so I would like to know if I'm wrong as I think the only bad option is using the Bus Facade.Thanks a lot!
The text was updated successfully, but these errors were encountered: