centrex / laravel-settings
Manage settings in laravel
Requires
- php: ^8.1|^8.2
- illuminate/database: ^10.0|^11.0
- illuminate/support: ^10.0|^11.0
Requires (Dev)
- larastan/larastan: ^2.0
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.8
- orchestra/testbench: ^8.8
- pestphp/pest: ^2.20
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- rector/rector: ^1.1
- spatie/laravel-ray: ^1.26
README
Settings for Laravel allows you to store your application settings in the database. It works alongside of the built-in configuration system that Laravel offers. With this package, you can store application specific settings.
Contents
Installation
You can install the package via composer:
composer require centrex/laravel-settings
You can publish the config file with:
php artisan vendor:publish --tag="settings-config"
You can publish and run the migrations with:
php artisan migrate
Usage
To get and retrieve stored settings, you can do it easily with the Settings Facade or by using the settings() helper function:
// Setting Settings::set('foo', 'bar'); settings()->set('foo', 'bar'); settings(['foo' => 'bar']); // Retrieving Settings::get('foo'); // 'bar' settings()->get('foo'); settings('foo');
Testing
๐งน Keep a modern codebase with Pint:
composer lint
โ Run refactors using Rector
composer refacto
โ๏ธ Run static analysis using PHPStan:
composer test:types
โ Run unit tests using PEST
composer test:unit
๐ Run the entire test suite:
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.