Download the PHP package foxws/laravel-relatable without Composer
On this page you can find all versions of the php package foxws/laravel-relatable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download foxws/laravel-relatable
More information about foxws/laravel-relatable
Files in foxws/laravel-relatable
Package laravel-relatable
Short Description Relate Eloquent models to other models, with a base score and boost to control their priority.
License MIT
Homepage https://github.com/foxws/laravel-relatable
Informations about the package laravel-relatable
Laravel Relatable
Relate Eloquent models to other models — of any type — and control how strongly they relate. Each relation has a base score and a boost; their product, the relation's weight, orders the related models.
Relations are directed: Action can relate to Fastpace with a score of 1.0 and to Genre with 0.5, while Genre relates back to Action with a score of its own.
Installation
You can install the package via Composer:
The migration for the relatables table runs automatically. You may publish all of the package's resources at once:
Or, you may publish each resource individually:
Usage
Add the InteractsWithRelated trait to each model that relates to others:
Then relate models, with an optional score and boost:
See the documentation for mutual relations, scoring, querying relations, and configuration.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Thank you for considering contributing to Laravel Relatable! Please review our contributing guide to get started.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- francoism90
- All Contributors
Inspired by spatie/laravel-relatable.
License
Laravel Relatable is open-sourced software licensed under the MIT license.
All versions of laravel-relatable with dependencies
illuminate/contracts Version ^12.0|^13.0
illuminate/database Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0