Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 2
    but - aren't jobs "supposed" to be queued? Sometimes we probably do want it to be queued but not all the time. Why not use commands instead? What if you want to write some business logic that may be executed as a command or an event or a queued? Commented Aug 23, 2016 at 13:46
  • 3
    Jobs don't need to be queued. You specify that by implementing the interface on the job ShouldQueue that Laravel provides. If you want to write Business logic in a command or event, just fire the job inside those events / commands. Laravels jobs are extremely flexible, but in the end they are just plain service classes. Commented Mar 10, 2017 at 16:13
  • 1
    Very good point! Also jobs can be used immediately by the dispatchSync() method which should ignore ShouldQueue. Commented Mar 4, 2021 at 16:49