Download the PHP package litvinjuan/laravel-cascade-soft-deletes without Composer

On this page you can find all versions of the php package litvinjuan/laravel-cascade-soft-deletes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-cascade-soft-deletes

Cascades soft delete and restore operations in Laravel Models

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package is for cascading soft delete and restore operations on your related models. When a model gets soft deleted, the configured related models get soft deleted as well. When the original model is restored, its soft-deleted related models algo get restored.

Installation

You can install the package via composer:

You can publish the config file with:

Soft Deleting

Simply add the trait to your models and configure the cascading relations either via the cascadeSofDeleteRelations property or the getRelationsForCascadeSoftDeletes method.

If your cascading related model also has the CascadeSoftDeletes trait, its related models will also be soft-deleted.

In the following example, soft deleting a project, will also soft delete its tasks. And soft deleting a team, will soft delete its projects, and in turn, all their respective tasks will also be soft deleted.

Restoring

Restoration works very similarly. By default, it restores the same relations that were soft deleted, but you can customize the relations to be restored by setting the cascadeRestoreRelations or implementing the getRelationsForCascadeRestore.

If you want to disable restoration all together, go into the cascade-soft-deletes config and set cascade_restores to false.

By default, when restoring related models, the package will only restore models that were deleted at the same time or after the parent model. This is to make sure we don't restore a child model that was soft deleted individually in a previous time. If you want to restore all models regardless of when they were soft deleted, you can go into the configuration file and set ignore_deleted_at_when_restoring to true.

Testing

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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


All versions of laravel-cascade-soft-deletes with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package litvinjuan/laravel-cascade-soft-deletes contains the following files

Loading the files please wait ....