tenantcloud / laravel-boolean-softdeletes
Laravel soft deletes optimization for high load queries
Installs: 85 276
Dependents: 1
Suggesters: 0
Security: 0
Stars: 26
Watchers: 1
Forks: 16
Open Issues: 2
Requires
- php: >=8.2
- illuminate/console: ^9.0|^10.0|^11.0|^12.0
- illuminate/contracts: ^10.0|^11.0|^12.0
- illuminate/database: ^9.0|^10.0|^11.0|^12.0
- illuminate/support: ^9.0|^10.0|^11.0|^12.0
Requires (Dev)
- nunomaduro/larastan: ^2.6|^3.1
- orchestra/testbench: ^8.5|^9.0|^10.0
- pestphp/pest: ^2.8|^3.7
- php-cs-fixer/shim: ^3.54
- phpstan/phpstan: ~1.10.21|^2.1
- phpstan/phpstan-mockery: ^1.1|^2.0
- phpstan/phpstan-phpunit: ^1.3|^2.0
- phpstan/phpstan-webmozart-assert: ^1.2|^2.0
- tenantcloud/php-cs-fixer-rule-sets: ~3.3.1
This package is auto-updated.
Last update: 2025-03-16 21:41:11 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(false)->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 10 - laravel-boolean-softdeletes 5.* For Laravel 11 - laravel-boolean-softdeletes 6.* For Laravel 12 - laravel-boolean-softdeletes 7.*
Change log
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING 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.