c-arena / eloquent-stalker
Visualize eloquent models information
Fund package maintenance!
c-arena
Requires
- php: ^8.2
- illuminate/contracts: ^10.0||^11.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.9
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^2.34
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-laravel: ^2.3
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- spatie/laravel-ray: ^1.35
README
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'.
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.