Skip to content

adding a link to edit trashed entries to the Actions column of the section addedby TrashOperation #1137

Discussion options

You must be logged in to vote

I came up with a few ways to do this.

Method # 1

Copy setupTrashFilter() from backpack/pro/src/Http/Controllers/Operations/Traits/TrashFilter.php to your custom CRUD and add the button:

CRUD::addButton('line', 'edit_trashed', 'view', 'vendor.backpack.crud.buttons.edit_trashed');

Then add your new button to this line:

$buttons_to_remove = array_filter(Arr::pluck($this->crud->buttons(), 'name'), function ($item) {
    return !in_array($item, ['destroy', 'restore', 'trash']);
});

Then create resources/views/vendor/backpack/crud/buttons/edit_trashed.blade.php with the following contents:

   <a href="{{ url($crud->route.'/'.$entry->getKey().'/edit') }}" class="btn btn-sm btn-link">
       <i …

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@prescriptionlifeline
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by prescriptionlifeline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants