Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JobClass::dispatch() respects ShouldBeUnique #113

Open
gerardnll opened this issue Jan 30, 2025 · 1 comment
Open

JobClass::dispatch() respects ShouldBeUnique #113

gerardnll opened this issue Jan 30, 2025 · 1 comment

Comments

@gerardnll
Copy link

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!

Copy link

welcome bot commented Jan 30, 2025

Wow, it’s your first issue here! We are glad that you want to improve this repository 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant