Closed acewebsa closed 5 years ago
I have the same problem. The variable "fields" passed in the json response is the problem. If you remove it from the response the preview call returns 200, but I don't understand why.
Yes you are right. How bizarre. I think I might look deeper for a fix.
Ok, if you find the solution, write it here. I will do the same if I find it first. Thanks.
Cheers will do.
It's certainly related to #16 When you take the BelongsTo out of $fields, it then succeeds.
Added this to the import controller, and it worked. Not real pretty though.
foreach ($fields as $key => &$field)
{
foreach ($field as $k => &$f)
{
if (get_class($f) == 'Laravel\Nova\Fields\BelongsTo')
{
unset($fields[$key][$k]);
}
}
}
Thanks for your help.
Route::get('/preview/{file}', 'ImportController@preview'); is giving a 404 error. If I do a dd just before the return line it is returned, so it is definitely finding the preview function without issue. Can't work out why this returns 404 though. Any thoughts on why this might be? Not sure if its related to #16 as I have a lot of resources with BelongsTo Fields in the project.