Downloads
Stars
Version
Most of my applications use models with the SoftDeletes
trait.
Therefore on all my validation rules I always have to specify the whereNull
additional statement to an exists
validation rule.
This package provide a shortcut exists_without_soft_deleted
rule for it.
composer require thtg88/laravel-exists-without-soft-deleted-rule
You can publish the configuration file and views by running:
php artisan vendor:publish --provider="Thtg88\ExistsWithoutSoftDeletedRule\ExistsWithoutSoftDeletedRuleServiceProvider"
Laravel Exists Without Soft Deleted Validation Rule exposes a validation rule to check existence of a model, without soft-deleted ones.
The validation rule is available using exists_without_soft_deleted
.
If you are validating the name
attribute on the users
table for example, you can use the rule as:
'name' => 'exists_without_soft_deleted:users',
For other example of usage, it's equivalent to Laravel's exists
rule.
See the official Laravel documentation for more information
Laravel Exists Without Soft Deleted Validation Rule is open-sourced software licensed under the MIT license.
If you discover a security vulnerability within Laravel Exists Without Soft Deleted Validation Rule, please send an e-mail to Marco Marassi at [email protected]. All security vulnerabilities will be promptly addressed.