Framework: dispatchFrom and dispatchFromArray No Longer In DispatchesJobs Trait

Created on 8 Dec 2015  路  14Comments  路  Source: laravel/framework

I commonly use dispatchFrom along with a FormRequest object to make use of the data submitted by the user to my applications. I use the exact methodology described in the documentation here:

http://laravel.com/docs/master/queues#dispatching-jobs-from-requests

I've noticed that the DispatchesJobs trait in the master and 5.2 branches no longer includes dispatchFrom and dispatchFromArray methods. They were removed about a week ago (but I notice that the methods still exist in Illuminate\Contracts\Bus\Dispatcher). So do the docs need to be updated to show that these methods are no longer available in the trait?

Most helpful comment

It would be helpful to mention this in the 5.1 --> 5.2 upgrade guide. As far as I can see, it's not there.

All 14 comments

They were removed in 5.2.

And the docs?

Ping @taylorotwell. Seems the removal was incomplete.

Apologies - my IDE was lagging behind. Illuminate\Contracts\Bus\Dispatcher no longer contains the old methods. But the docs don't seem to be up-to-date with these changes.

The 5.2 docs aren't necessarily kept up to date daily. They are updated before release.

Why was this removed? I've found it very useful... If I have know that this was removed I would most likely not update to L5.2 this soon.

They're not coming back, and non-self handling thing are not coming back I'm afraid.

If you need to use the old bus, the Laravel Collective are maintaining it:

https://laravelcollective.com/docs/5.2/bus

I've just re-written my dispatchers though.

Was there a particular reason this was done away with?

Taylor just doesn't like the idea, as far as I understand.

Can I also recommend https://github.com/AltThree/Bus. :trollface:

I guess because it forces us to write what we pass into the job, it becomes more readable?

There's probably a performance benefit to manually mapping in all the parameters instead of having that done automagically for you.

It would be helpful to mention this in the 5.1 --> 5.2 upgrade guide. As far as I can see, it's not there.

Was this page helpful?
0 / 5 - 0 ratings