anaseqal / nova-import

Laravel Nova Import Action
72 stars 28 forks source link

queue issue #16

Closed ali-shabani closed 4 years ago

ali-shabani commented 4 years ago

Hi, in your DispatchAction class line 58

protected static function queueForModels(ActionRequest $request, Action $action, $method, Collection $models)

you typehint $models with Collection, but you use

use Illuminate\Support\Collection;

instead of

use Illuminate\Database\Eloquent\Collection;

this cause this issue: Argument 4 passed to Anaseqal\NovaImport\Actions\CallQueuedAction::__construct() must be an instance of Illuminate\Database\Eloquent\Collection, instance of Illuminate\Support\Collection given, called in ... thank you for your great job

ali-shabani commented 4 years ago

this error will occur when you use ShouldQueue interface on your action class

anaseqal commented 4 years ago

Hello @pyramid-ali

Consider using Laravel Excel Queues instead of Nova Action Queues:

https://docs.laravel-excel.com/3.1/imports/queued.html