Download the PHP package ajaycalicut17/laravel-trash without Composer
On this page you can find all versions of the php package ajaycalicut17/laravel-trash. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ajaycalicut17/laravel-trash
More information about ajaycalicut17/laravel-trash
Files in ajaycalicut17/laravel-trash
Package laravel-trash
Short Description Laravel package to manage soft delete.
License MIT
Homepage https://github.com/ajaycalicut17/laravel-trash
Informations about the package laravel-trash
Laravel Trash ๐๏ธ
The Laravel "soft delete" functionality is effectively managed through the use of this package. It works like trash in your system.
Installation โ๏ธ
-
You can install the package via composer:
-
Run migrations to create tables for this package:
-
Check model is "soft delete" able, this package work by using laravel "soft delete" functionality:
-
To enable this package for a model, add the Ajaycalicut17\LaravelTrash\Traits\Trashable trait to the Eloquent model:
-
To start listening "trashed" model event, define a $dispatchesEvents property on your Eloquent model:
-
To override the trash name (Optional):
-
Publishing the config file (Optional):
- To periodically delete the model from the trash, add model:prune Artisan command in your application's App\Console\Kernel class and change the config\trash.php pruning status to "true", you can also enter your pruning period here. (Optional):
Usage ๐จ
-
To get all trash model data:
-
To get all trash model and associated model data:
-
To restore associated model form trash:
-
To delete trashed model and associated model:
- To delete all trashed model and associated model:
Testing ๐งช
Changelog ๐
Please see CHANGELOG for more information what has changed recently.
Contributing ๐ค
Please see CONTRIBUTING for details.
Credits ๐ฅ
- Ajay A
- All Contributors
License ๐
The MIT License (MIT). Please see License File for more information.