nitinkaware/laravel-dependable-softdelete

A laravel dependable soft delete package
16 4
Install
composer require nitinkaware/laravel-dependable-softdelete
Latest Version:1.0.0
PHP:^7.1
License:MIT
Last Updated:Jan 21, 2018
Links: GitHub  ·  Packagist
Maintainer: nitinkaware

laravel-dependable-softdelete

This package allows you to delete the dependant relationship of your model.

Installation

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.

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email nitin.kaware1@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

reliese/laravel

Reliese Components for Laravel Framework code generation.

3,954,390 1,705
php-tmdb/laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the...

53,312 160
laravel-ja/laravel

The Laravel Framework.

5,667 17
kavenegar/laravel

laravel 4 and 5 kavenegar integration

366,462 86
laravel/laravel

The skeleton application for the Laravel framework.

64,738,171 84,935