The package offers an unprecedented level of flexibility, allowing users to inherit settings from any model infinitely deep. This capability empowers users to combine and extend configurations to suit their specific requirements. You can also set default values for settings that are not inherited from any model.
- Add tests
- Caching
You can install the package via composer:
composer require oceceli/inheritable-model-settings
You can publish and run the migrations with:
php artisan vendor:publish --tag="inheritable-model-settings-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="inheritable-model-settings-config"
This is the contents of the published config file:
return [
];
Optionally, you can publish the views using
php artisan vendor:publish --tag="inheritable-model-settings-views"
Add the HasSettings
trait and Adjustable
interface to any model you want to have settings.
$model->setSetting('key', 'value');
$model->getSetting('key');
$model->settings;
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.