what's the point of CRUD::setOperationSetting('withTrashFilter', false); if editing trashed users gives error 404? #1255
-
Quoting https://backpackforlaravel.com/docs/6.x/crud-operation-trash#how-to-configure-1 :
What's the point of having trashed items in your List view if half of the actions that the List view provides (eg. Edit) yield an error 404 when you try to perform them? Like even making the anonymous function in So, again, I ask... what's the point? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I looked into some more hackish approaches as well. In vendor/backpack/crud/src/app/Library/CrudPanel/Traits/Read.php there's this: public function getEntry($id)
{
if (! $this->entry) {
if ($this->getOperationSetting('eagerLoadRelationships')) {
$this->eagerLoadRelationshipFields();
}
$this->entry = $this->getModelWithCrudPanelQuery()->findOrFail($id);
$this->entry = $this->entry->withFakes();
}
return $this->entry;
} Replacing In // get the info for that entry (include softDeleted items if the trait is used)
if ($this->crud->get('show.softDeletes') && in_array('Illuminate\Database\Eloquent\SoftDeletes', class_uses($this->crud->model))) {
$this->data['entry'] = $this->crud->getModel()->withTrashed()->findOrFail($id);
} else {
$this->data['entry'] = $this->crud->getEntryWithLocale($id);
} But I'm not seeing anything analogous to that in vendor/backpack/crud/src/app/Library/CrudPanel/Traits/UpdateOperation.php. I mean, in the So, again, my question still stands. What's the point of having trashed items in your List view if half of the actions that the List view provides (eg. Edit) yield an error 404 when you try to perform them? |
Beta Was this translation helpful? Give feedback.
-
Hello @prescriptionlifeline The point of this functionality is to give developers more control over how trashed items are handled. Here are a few reasons why you might want to disable the default trash filter:
Let me know if you have any other question. Cheers. |
Beta Was this translation helpful? Give feedback.
Hello @prescriptionlifeline
The point of this functionality is to give developers more control over how trashed items are handled. Here are a few reasons why you might want to disable the default trash filter:
Let me know if you have any other question.
Cheers.