Closed stiknoltz closed 5 years ago
Wasn't sure of the best way to provide this, but here's a diff of the proposed solution:
index 2bad80b..1d19f00 100644
--- a/src/Http/Controllers/ImportController.php
+++ b/src/Http/Controllers/ImportController.php
@@ -45,7 +45,7 @@ class ImportController
$model = $resource::$model;
return new $resource(new $model);
- })->mapWithKeys(function (Resource $resource) use ($request) {
+ })->mapWithKeys(function (NovaResource $resource) use ($request) {
return [$resource->uriKey() => $resource->creationFields($request)];
});```
@stiknoltz I've just released this fix. Could you update your version and let me know if it's working for you?
First off thanks for creating this library. I've found it very useful.
I did notice the following which can occur in certain instances where you're including other Nova Resource generating Packages.
There is a type hint on line 48 of
src/Http/Controllers/ImportController.php
for anApp\Nova\Resource
class which fails if the Resource is from another vendor package which generally referenceLaravel\Nova\Resource
and not one created locally.Since
Laravel\Nova\Resource
asNovaResource
is already imported, the fix was was just a matter of changing theResource
type hint toNovaResource
I think #7 might be related to this issue.