Closed axp-dev closed 2 years ago
Hi! I could not reproduce this issue. Can you try clearing your routes cache? Thanks!
There are no routes in the cache
php artisan route:list |
Domain | Method | URI | Name | Action | Middleware |
---|---|---|---|---|---|---|
GET HEAD | nova-vendor/nova-settings/settings | nova-settings.get | OptimistDigital\NovaSettings\Http\Controllers\SettingsController@get | nova OptimistDigital\NovaSettings\Http\Middleware\Authorize OptimistDigital\NovaSettings\Http\Middleware\SettingsPathExists |
||
POST | nova-vendor/nova-settings/settings | nova-settings.save | OptimistDigital\NovaSettings\Http\Controllers\SettingsController@save | nova |
config/nova-settings.php
<?php
return [
'table' => 'settings',
'base_path' => 'settings',
'reload_page_on_save' => false,
'models' => [
'settings' => App\Models\Settings::class,
],
];
app/Models/Settings.php
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use OptimistDigital\NovaSettings\Models\Settings as Model;
class Settings extends Model
{
use HasFactory;
}
Interesting, you're missing the delete image route altogether. I can look into it again tomorrow.
This route is missing: https://github.com/optimistdigital/nova-settings/blob/895425944e26b552ef3d8f993ca2f7327fb2ce07/routes/api.php#L22
I didn't see him. But he is
php artisan route:list |
Domain | Method | URI | Name | Action | Middleware |
---|---|---|---|---|---|---|
GET HEAD | nova-vendor/nova-settings/settings | nova-settings.get | OptimistDigital\NovaSettings\Http\Controllers\SettingsController@get | nova OptimistDigital\NovaSettings\Http\Middleware\Authorize OptimistDigital\NovaSettings\Http\Middleware\SettingsPathExists |
||
POST | nova-vendor/nova-settings/settings | nova-settings.save | OptimistDigital\NovaSettings\Http\Controllers\SettingsController@save | nova | ||
DELETE | nova-api/nova-settings/{path}/field/{fieldName} | OptimistDigital\NovaSettings\Http\Controllers\SettingsController@deleteImage | nova |
If you add an entry to web.php, then everything works correctly
Route::delete('/nova-api/nova-settings/{path}/field/{fieldName}', 'OptimistDigital\NovaSettings\Http\Controllers\SettingsController@deleteImage');
Huge thanks to @ahmetbedir who fixed the issue. :) It should now work as intended in version 3.2.3. Good luck!
Version 3.2.1 - Nova Version: 3.27.0
Code:
Error deleting image: