c-arena/eloquent-stalker

Visualize eloquent models information

1.1.1 2024-11-07 14:40 UTC

This package is auto-updated.

Last update: 2024-11-07 15:57:26 UTC


README

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

It helps visualize the eloquent models and their defined relationships. Very useful when comparing to the actual database so we can know what relationships are missing.

Installation

You can install the package via composer:

composer require c-arena/eloquent-stalker

Now you need to run the installer:

php artisan eloquent-stalker:install

Optionally, you can publish the views using

php artisan vendor:publish --tag="eloquent-stalker-views"

You have to make sure the namespace and class name are directly related to the path of the models. Otherwise, it won't work as expected. We use the app_path() to look for all the existant models in your project.

Usage

There are two ways in which you can use this package:

Console

You can list all your models with its info using an artisan command we provide for you:

php artisan eloquent-stalker:models

You might also want to list all the relationships

php artisan eloquent-stalker:relationships

Optionally, you can pass the name of a model to check its relationships

php artisan eloquent-stalker:relationships User

Browser

We provide a route (which you can configure in the config file) that will be shown in development mode. By default, the route will be '/eloquent-stalker'.

alt text

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.