定制 nitinkaware/laravel-dependable-softdelete 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nitinkaware/laravel-dependable-softdelete

Composer 安装命令:

composer require nitinkaware/laravel-dependable-softdelete

包简介

A laravel dependable soft delete package

README 文档

README

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.

统计信息

  • 总下载量: 16
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-03-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固