Download the PHP package priblo/laravel-has-attributes without Composer
On this page you can find all versions of the php package priblo/laravel-has-attributes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download priblo/laravel-has-attributes
More information about priblo/laravel-has-attributes
Files in priblo/laravel-has-attributes
Package laravel-has-attributes
Short Description EAV based attributes as a Trait
License MIT
Informations about the package laravel-has-attributes
Laravel Has Attributes
EAV Attributes in an handy Trait
This package provides a trait to attach attributes to any Eloquent model. The common use case is to add Settings to a model.
Attributes are stored following the Entity-Attribute-Value model. Data is abstracted using the Decorator pattern.
Install
Requires: Laravel >=5.4
Composer
Laravel
This package supports Auto Discovery. If your Laravel version doesn't support it or you have disabled it, you can install this package by adding to the 'providers' array in ./config/app.php
Then run:
Then migrate:
Cache
Caching requires a driver which supports tags. File and Database won't work, redis is suggested. Please make sure to either disable caching in the config or use the array driver for local development.
In the has-settings.php config file you can enable/disable caching and set the cache expiration time.
Caching is enabled by default
Notes
Please do remember that each of the settings in a EAV model are set in a TEXT field, thus a value of true will be stored as "1"
Roadmap
- More tests
- Expand README.MD
All versions of laravel-has-attributes with dependencies
illuminate/support Version ~5.4.0|~5.5.0|~5.6.0|~5.7.0
illuminate/config Version ~5.4.0|~5.5.0|~5.6.0|~5.7.0
illuminate/database Version ~5.4.0|~5.5.0|~5.6.0|~5.7.0