tenantcloud / laravel-boolean-softdeletes
Laravel soft deletes optimization for high load queries
Installs: 43 382
Dependents: 1
Suggesters: 0
Security: 0
Stars: 22
Watchers: 2
Forks: 10
Open Issues: 3
Requires
- php: ^5.6|^7|^8
- illuminate/console: ^5|^6|^7|^8|^9
- illuminate/database: ^5|^6|^7|^8|^9
- illuminate/support: ^5|^6|^7|^8|^9
Requires (Dev)
- phpunit/phpunit: >=5.4.3
- squizlabs/php_codesniffer: ^2.3
This package is auto-updated.
Last update: 2023-05-08 13:41:50 UTC
README
This package is designed for high-load applications and optimizes queries with soft deletes by utilizing a boolean field for indexing, which is more efficient than using unique timestamps.
Install
Via Composer
$ composer require tenantcloud/laravel-boolean-softdeletes
Add Webkid\LaravelBooleanSoftdeletes\SoftDeletesBoolean
trait to models with soft deletes.
Then create and run migration to add soft delete boolean field
Schema::table('users', function (Blueprint $table) { $table->boolean('is_deleted')->default(0)->index(); });
If you want to use this package for existing project you can use built-in command
php artisan softdeletes:migrate
Also you can change default column name is_deleted
to any other by setting static property IS_DELETED
of certain model
Versions compatibility
For Laravel 5 - laravel-boolean-softdeletes 0.1.2 For Laravel 6 - laravel-boolean-softdeletes 1.0.0 For Laravel 7 - laravel-boolean-softdeletes 2.0.0 For Laravel 8 - laravel-boolean-softdeletes 3.* For Laravel 9 - laravel-boolean-softdeletes 4.*
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email kolodiy.ivan.i@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.