How to edit trashed item

19 Views Asked by At

I want to edit a trashed item which is soft deleted, but it is giving 404 error. The url is like /admin/orders/7/edit Also the show page giving 404 /admin/orders/7/show

I tried implementing below:

  1. Trash Operation.
  2. custom middleware to ResolveTrashedModelForBackpack
1

There are 1 best solutions below

0
Jorge On

You can not edit a deleted item; to do this, you need to restore, by default, in a query is checked that is_deleted is null.

If you want to add this feature, you will need to override the query like this:

Model::withTrashed()->get();

Cheers.

Related Questions in EDIT-TRASHED-ITEM-BACKPACK