Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

The handleRequest override method needs to send different collection type. #13

Closed
nrobates opened this issue Jul 1, 2020 · 0 comments
Closed

Comments

@nrobates
Copy link
Contributor

nrobates commented Jul 1, 2020

In the DetachedAction file the handleRequest method does the following:

$results = DispatchAction::forModels(
            $request,
            $this,
            $method,
            collect([]),
            $fields
);

The problem with this is that the 4th parameter for DispatchAction::forModels method is expecting an instance of Illuminate\Database\Eloquent\Collection and because of collect([]) it is getting an instance of Illuminate\Support\Collection. As a result, this is the exception that gets thrown:

Argument 4 passed to Laravel\Nova\Actions\CallQueuedAction::__construct() must be an instance of Illuminate\Database\Eloquent\Collection, instance of Illuminate\Support\Collection given
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants