Feb 5, 2025
0
Level 6
How to avoid error pop-up 404 after delete?
I have this SettingsResource for our settings management, instead of id as primary we change it to "key". Though the record is delete but after you click confirm in the confirmation modal a pop-up of error 404|NOT FOUND is pop
I tried this but same error occured
Action::make('delete')
->label('Delete')
->icon('heroicon-o-trash')
->color('danger')
->action(function ($record) {
// Perform the deletion logic here
$record->delete();
// Optionally, add a success notification
Notification::make()
->title('Record Deleted')
->body('The record has been deleted successfully.')
->success()
->send();
})
->successRedirectUrl(SettingResource::getUrl('index'))
also this
Action::make('delete')
->label('Delete')
->successRedirectUrl(SettingResource::getUrl('index'))
This is my model
Class Setting extends Model implements Cacheable
{
use LogsActivity;
protected $primaryKey = 'key';
}
Though i add id in the migration to set the subject_id in the logger
Please or to participate in this conversation.