Download the PHP package mrdth/laravel-model-settings without Composer
On this page you can find all versions of the php package mrdth/laravel-model-settings. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mrdth/laravel-model-settings
More information about mrdth/laravel-model-settings
Files in mrdth/laravel-model-settings
Package laravel-model-settings
Short Description Easy to use way to add settings to any Eloquent model
License MIT
Homepage https://github.com/mrdth/laravel-model-settings
Informations about the package laravel-model-settings
Easy to use way to add settings to any Eloquent model
This package utilizes Eloquents JSON casting to provide a simple way to add settings to any Eloquent model.
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
Migrations
First add the settings column to your model's migration.
For existing models you can create a migration using our artisan command.
To change the column used for settings you can update the MRDTH_MODEL_SETTINGS_COLUMN_NAME
in your .env
file.
Models
Next add the HasSettings
trait to any Eloquent model you want to have settings.
Using the model settings
Once the trait is added you can interact with the settings using methodsL
Query Scopes
You can also query models based on their settings.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
- mrdth
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-model-settings with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0