Package Data | |
---|---|
Maintainer Username: | nitinkaware |
Maintainer Contact: | nitin.kaware1@gmail.com (Nitin Kaware) |
Package Create Date: | 2017-03-23 |
Package Last Update: | 2018-01-21 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-23 03:13:38 |
Package Statistics | |
---|---|
Total Downloads: | 15 |
Monthly Downloads: | 1 |
Daily Downloads: | 0 |
Total Stars: | 4 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
This package allows you to delete the dependant relationship of your model.
You can install the package via Composer:
$ composer require nitinkaware/laravel-dependable-softdelete
Now add the service provider in config/app.php file:
'providers' => [
// ...
NitinKaware\DependableSoftDeletable\SoftDeletableServiceProvider::class,
];
##How to use the package?
Just define the relationship array on model.
Filename: User.php
class User extends Model {
use DependableDeleteTrait, SoftDeletes;
protected static $dependableRelationships = ['comments'];
public fuction comments()
{
return $this->hasMany(Comment::class);
}
}
Now when you will delete the user, all the comments associated with deleting user will automatically deleted. If you have other relation defined in Comment.php model, then they will be deleted too.
Please see CHANGELOG for more information on what has changed recently.
$ composer test
Please see CONTRIBUTING and CONDUCT for details.
If you discover any security related issues, please email nitin.kaware1@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.