Closed ifaniqbal closed 4 years ago
This happen on v1.4, Laravel 6.10, Nova 2.9.
Nevermind, my bad. I had to run these commands to solve this issue:
php artisan route:clear
php artisan config:clear
php artisan cache:clear
php artisan view:clear
I thought php artisan optimize
alone is enough.
But wait, when I run php artisan optimize
again, the error occurs.
Seems that the route not getting cached.
The result of php artisan route:list
shows that this route:
DELETE | nova-api/nova-settings/settings/field/{fieldName}
is mentioned first before this route:
DELETE | nova-api/{resource}/{resourceId}/field/{field}
Meanwhile, these two routes:
POST | nova-vendor/nova-settings/settings
GET|HEAD | nova-vendor/nova-settings/settings
are mentioned after nova-api routes.
Could it be the problem?
To make it work, I had to manually add the route to my routes/web.php
:
Route::delete('nova-api/nova-settings/settings/field/{fieldName}', '\OptimistDigital\NovaSettings\Http\Controllers\SettingsController@deleteImage');
Hey! Sorry for the late reply, I was on vacation for the week.
You're exactly right. The issue is that when the routes are cached, the nova-api/nova-settings/settings/field/{fieldName}
route from nova-settings
is put before the Nova actual routes, which causes it to be overwritten. I'm looking into how I can fix this right now.
Hey! I released version 2.0.2 with a fix. Let me know if it works for you now. :)
It works! Thank you very much 👍
This is weird. Already run
php artisan optimize
and check the route viaphp artisan route:list | grep nova-settings
I can confirm route exists. But, this error still happen when I try to delete image.Any suggestion?