Download the PHP package mhdobd/eloquent-relation-guard without Composer

On this page you can find all versions of the php package mhdobd/eloquent-relation-guard. 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 eloquent-relation-guard

Eloquent Relation Guard

Laravel package by MuhammadObadaa


Scan, inspect, and (optionally) force‐delete Eloquent models along with their HasOne/HasMany branches—without relying on database‐level cascade or restrict rules.

OnDelete, you can walk through a model’s HasOne/HasMany relations (to any depth), get a nested “tree” of related IDs, check whether a model is safe to delete, or forcibly delete the entire sub‐tree in one shot.


Installation

Require the package via Composer:


Configuration

Publish the configuration file:

This will copy config/eloquent-relation-guard.php into your application’s config/ directory.


Usage

  1. Use the Trait in Your Model Add the HasRelationalDependencies trait to any Eloquent model you want to protect/scan.

  2. Check if a Record Can Be Deleted

  3. Get the Full Relation “Tree” (with IDs)

  4. Force‐Delete a Model and All Related Records

  5. Console Command: record:tree You can visualize a model’s relation tree (with IDs) from the CLI:

    • Post : The model class name, it should be located in app/models/ directory
    • 42 : ID of the record to inspect
    • 2 : Depth (how many nested levels to scan; use -- -1 for unlimited)

    Example Output:

for more details check the Documentation


TODO


Contributing

If you discover bugs, have feature requests, or want to contribute code, please use the GitHub issue tracker:

Issues & Contributions: https://github.com/MuhammadObadaa/eloquent-relation-guard/issues

Feel free to fork the repository, open a PR, and follow these basic guidelines:

  1. Fork the repo and create a new branch for your feature/fix.
  2. Write at least one test (where applicable) demonstrating the expected behavior.
  3. Update CHANGELOG.md and README.md if you add or change functionality.
  4. Submit a pull request—describe what you changed and why.

License

Eloquent Relation Guard package is open source, licensed under MIT. Feel free to use, modify, and redistribute.


All versions of eloquent-relation-guard with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
illuminate/support Version >=6.0 <12.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 mhdobd/eloquent-relation-guard contains the following files

Loading the files please wait ...