dcasia / nova-filepond

A Nova field for uploading File, Image and Video using Filepond.
MIT License
48 stars 27 forks source link

404 from `/process` endpoint when Resource contains a BelongsTo relationship #6

Closed gabe565 closed 4 years ago

gabe565 commented 4 years ago

Loving this plugin so far, but I am having a strange issue.

Something goes wrong while trying to load rulesForCreation that causes Laravel to return a 404 response. This only happens when the resource has a BelongsTo field which is shown on creation.

milewski commented 4 years ago

Can you share how are you using it? what rules did you set

gabe565 commented 4 years ago

Sure! Sorry, should've given that at first.

The BelongsTo itself has no rules, it is defined as:

BelongsTo::make('Role')

The Filepond config is also pretty simple:

Filepond::make('Avatar')
    ->image()

The call stack for generating BelongsTo rules is really deep, but it seems to actually die in associatableQueryMethod() of laravel/nova/src/Fields/BelongsTo.php. $request->resource() is null, so abort_if(is_null($resource), 404); is triggered in resource() in laravel/nova/src/Http/Requests/InteractsWithResources.php.

milewski commented 4 years ago

@gabe565 sorry for the delay, fixed on version v0.2.8