We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NoneDeletableModel
Ads a simple trait called NoneDeletableModel to the package. The trait could then be used in Eloquent models to deny all deletion attempts:
declare(strict_types=1); namespace F9Web\LaravelDeletable\Traits\Traits; use F9Web\LaravelDeletable\Traits\RestrictsDeletion; trait NoneDeletableModel { use RestrictsDeletion; public function isDeletable() : bool { return false; } }
To prevent all deletion requests for a model:
declare(strict_types=1); namespace App\Models; use F9Web\LaravelDeletable\Traits\NoneDeletableModel; use Illuminate\Database\Eloquent\Model; class Order extends Model { use NoneDeletableModel; }
Now, orders cannot be deleted.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Ads a simple trait called
NoneDeletableModel
to the package. The trait could then be used in Eloquent models to deny all deletion attempts:To prevent all deletion requests for a model:
Now, orders cannot be deleted.
The text was updated successfully, but these errors were encountered: