Closed mariusconstantin2503 closed 8 months ago
Hey @mariusconstantin2503
I checked our demo, It's working there. https://demo.backpackforlaravel.com/admin/pet-shop/pet
For reference, you can check the demo's pet CRUD here: https://github.com/Laravel-Backpack/demo/blob/main/app/Http/Controllers/Admin/PetShop/PetCrudController.php
If this doesn't help, please share your CRUD controller to identify the issue.🤝
It's probably missing to add SoftDeletes
trait to the model. Also make sure you have the soft delete column in your database.
It's probably missing to add
SoftDeletes
trait to the model. Also make sure you have the soft delete column in your database.
Yup, sounds like that should be the problem.
Bug report
What I did
I enabled the trash operation adding the soft deletes on the model and the trait in the crud, as it is specified in the documentation. The trash and bulk trash are working but bulk restore not. I received an error "Call to undefined method Illuminate\Database\Eloquent\Builder::onlyTrashed()" It seems to come from here
What I expected to happen
To successfully restore the items
What happened
An exception is shown
What I've already tried to fix it
yes
Is it a bug in the latest version of Backpack?
After I run
composer update backpack/crud
the bug... is it still there? yesBackpack, Laravel, PHP, DB version
When I run
php artisan backpack:version
the output is: