cleisonfreitas/association-remover 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

cleisonfreitas/association-remover

Composer 安装命令:

composer require cleisonfreitas/association-remover

包简介

Esse pacote possibilita ao usuário realizar a exclusão de um registro em modelo cascata.

README 文档

README

How to apply

  • Install the package
composer require cleisonfreitas/association-remover

How to use

  • After installing, just call GerenciarRelacaoTrait in your model and define which relations will be deleted after removing the record

Example:

class YourClassModel extends Model
{
    use SoftDeletes, HasFactory, GerenciarRelacaoTrait;

    protected array $relacionamentos = [
        'relationOne',
        'relationTow',
    ];

    ...
}

All the relations listed will be removed in case of this record been deleted.

Important

If you define that some relation will be removed with GerenciarRelacaoTrait you have to apply the same feature to model/relation you mentioned.

Example:

class FirstModel extends Model
{
    use SoftDeletes, HasFactory, GerenciarRelacaoTrait;

    protected array $relacionamentos = [
        'seconModelRelation',
    ];

    ...
}

class SecondModel extends Model
{
    use SoftDeletes, HasFactory, GerenciarRelacaoTrait;

    protected array $relacionamentos = [];

    ...
}
  • The relacionamentos attribute can be empty

To more information, send me an email: cleison51@hotmail.com

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-08-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固