Download the PHP package perfect-drive/referable without Composer
On this page you can find all versions of the php package perfect-drive/referable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download perfect-drive/referable
More information about perfect-drive/referable
Files in perfect-drive/referable
Package referable
Short Description Automatically create routes for Models and Enums to make them referable in your Laravel backed SPA frontend
License MIT
Homepage https://github.com/perfect-drive/referable
Informations about the package referable
Automatically create routes for Models and Enums to make them referable in your SPA frontend
To populate drowdowns (or other ways of reference) in an SPA form a separate endpoint can be used to create the array of name/value pairs. This package allows you to automatically create routes for your Models and Enums to make them referable in your Laravel backed SPA frontend.
Installation
You can install the package via composer:
You can publish the config file with:
This is the contents of the published config file:
Usage
On a Model:
This will register the following route:
On an Enum:
This will register the following route:
Model Scopes
The 'ReferableScope' attribute can be used to define a custom scope (on a Model) to filter the referable items and create an additional route for it.
This will register the following route:
Enum Scopes
You can use the 'ReferableScope' attribute to define a custom scope method (on an Enum) to filter the referable items and create an additional route for it.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security Vulnerabilities
If you discover any security related issues, please email [email protected].
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of referable with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0||^12.0