Laravel Backpack redirect delete operation to list view

Viewed 40

I want to customize the delete operation such that whenever you delete an item, it goes back to the items list screen. I have tried following; that I believed must work:

public function destroy($id)
{
    $this->crud->hasAccessOrFail('delete');
    $this->crud->delete($id);      
    return redirect('/admin/students');
}

But it gives 405 methods not allowed error. Does anyone have a better suggestion on how to achieve it?

0 Answers
Related