在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):Askedio/laravel-soft-cascade开源软件地址(OpenSource Url):https://github.com/Askedio/laravel-soft-cascade开源编程语言(OpenSource Language):PHP 100.0%开源软件介绍(OpenSource Introduction):Laravel/Lumen Soft Cascade Delete & RestoreCascade delete and restore when using the Laravel or Lumen SoftDeletes feature. Why do I need it?To make soft deleting and restoring relations easy.If you enjoy features like MySQL cascade deleting but want to use Laravels SoftDeletes feature you'll need to do some extra steps to ensure your relations are properly deleted or restored. This package is intended to replace those steps with a simple array that defines the relations you want to cascade. InstallationInstall with composer
From Laravel 5.5 onwards, it's possible to take advantage of auto-discovery of the service provider. For Laravel versions before 5.5, you must register the service provider in your config/app.php
Lumen does not support the auto-discovery feature, you should manually add the provider.
UsageIn your
For restricted relation use. Example.
Nested relations work by defining After you've defined your relations you can simply trigger
It can also be used with query builder in this way because query builder listener is executed after query, we need to use transaction for rollback query on error due to restricted relationships
Supported Databases
TestingI have written some very basic tests, certainly more needs to be done here. If you find this useful please help by testing other databases or writing better unit tests because I must move on. Issues & ContributingI will be using this with MySQL in a new API so any issues I find related to my use will be resolved. If you find an issue with MySQL please report it and I will fix it. If you are using another database and have issues please contribute by submitting a pull request. I do not have time to test this with other database but assume all would work. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论