Skip to content

JobClass::dispatch() respects ShouldBeUniqueΒ #113

@gerardnll

Description

@gerardnll

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions