can't preview trashed Uers #1253
-
I followed the tutorial added at https://backpackforlaravel.com/articles/tutorials/how-to-create-a-trash-deleted-section-in-backpack-crud to add a Trash/Deleted section to my Backpack CRUD. It works well BUT I am unable to "Preview" (as implemented in
I prob need to add a Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Based on the knowledge sources provided, I can help you with this issue related to previewing trashed Users in Backpack CRUD. The problem you're experiencing is a known issue with the ShowOperation when dealing with soft-deleted items. To solve this, you need to modify the ShowOperation to include trashed items. Here's how you can do it:
protected function setupShowOperation()
{
CRUD::set('show.softDeletes', true);
} This setting allows the Show operation to access soft-deleted items Show operation add softDeletes support.
protected function setupShowOperation()
{
$this->crud->query = $this->crud->query->withTrashed();
} This will include trashed items in the query for the Show operation Github Issue: Unable to access revisions if Soft Delete is enable.
'softDeletes' => true, This will allow the Show operation to access soft-deleted items for all models with SoftDeletes Github Issue: Show operation addClause ignoring for SoftDeletes. By implementing one of these solutions, you should be able to preview trashed User accounts without encountering the 404 error. Remember to clear your application cache after making these changes:
If you're still experiencing issues after trying these solutions, it might be worth checking if there are any custom access conditions or global scopes affecting your User model that could be interfering with the Show operation for trashed items. ℹ️ Please note our AI Bot does not reply to follow-ups, this will be the only AI answer in this thread. If the AI helped you find the answer, please mark it as answered or write details below so it can learn. Then close the conversation. If not, please give more information for when a human reads this. ℹ️ Relevant sources: Github Issue (closed): ShowOpeartion with soft delete not working |
Beta Was this translation helpful? Give feedback.
Based on the knowledge sources provided, I can help you with this issue related to previewing trashed Users in Backpack CRUD. The problem you're experiencing is a known issue with the ShowOperation when dealing with soft-deleted items.
To solve this, you need to modify the ShowOperation to include trashed items. Here's how you can do it:
setupShowOperation
method. Add the following code:This setting allows the Show operation to access soft-deleted items Show operation add softDeletes support.