Inherit any setting from any model infinitely deep
oceceli/inheritable-model-settings is a Laravel package for inherit any setting from any model infinitely deep.
It currently has 1 GitHub stars and 30 downloads on Packagist.
Install it with composer require oceceli/inheritable-model-settings.
Discover more Laravel packages by oceceli
or browse all Laravel packages to compare alternatives.
Last updated
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.
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.