smorken / settings
Settings helper for Laravel
v11.0.2
2025-05-14 20:01 UTC
Requires
- php: ^8.2
- illuminate/cache: ^11.0|^12.0
- illuminate/console: ^11.0|^12.0
- illuminate/routing: ^11.0|^12.0
- illuminate/support: ^11.0|^12.0
- smorken/array-cache: ^9.0|^10.0
- smorken/components: ^v1.10.0
- smorken/controller: ^1.0|^2.0
- smorken/domain: ^v1.7.0
Requires (Dev)
- fakerphp/faker: ^1.15.0
- illuminate/support: ^11.0|^12.0
- mockery/mockery: ^1.0
- orchestra/testbench: ^9.0|^10.0
- phpunit/phpunit: ^11.0
- smorken/docker: *
- dev-master / 11.x-dev
- v11.0.2
- v11.0.1
- v11.0.0
- 10.x-dev
- v10.2.0
- v10.1.1
- v10.1.0
- v10.0.0
- 9.x-dev
- v9.2.0
- v9.1.5
- v9.1.4
- v9.1.3
- v9.1.2
- v9.1.1
- v9.1
- v9.0
- 8.x-dev
- v8.0
- 7.x-dev
- v7.0
- 6.x-dev
- v6.2
- v6.1
- v6.0
- v5.5.0-beta5
- v5.5.0-beta4
- v5.5.0-beta2
- v5.5.0-beta1
- 5.4.x-dev
- 5.1.x-dev
- v5.0.2
- v5.0.1
- v5.0.0
- dev-dev-5.5
- dev-rest_wip
This package is auto-updated.
Last update: 2025-05-14 20:02:22 UTC
README
License
This software is open-sourced software licensed under the MIT license
The Laravel framework is open-sourced software licensed under the MIT license
Requirements
- PHP 7.2+
- Composer
Installation
- add to your Laravel app composer.json
"require": {
"smorken/settings": "^6.0"
}
composer update
Service Provider should auto register itself. If not:
- add service provider to
config/app.php
'providers' => [
...
\Smorken\Settings\ServiceProvider::class,
- publish any needed files
$ php artisan vendor:publish --provider="Smorken\Settings\ServiceProvider" --tag=config #view and config available
- run the migrations
$ php artisan migrate
Use
app(Smorken\Settings\Contracts\Storage\Setting::class)
provides an instance of Smorken\Settings\Contracts\Storage\Setting
setting()
is a shortcut for the same
Smorken\Settings\Facades\Setting::class
is a facade accessor
Get a setting value:
$s = app(Smorken\Settings\Contracts\Storage\Setting::class);
$value = $s->get('foo.key');
$value = setting('foo.key', 'default_value');
$value = \Smorken\Settings\Facades\Setting::get('foo.key', 'default_value');
Set a settings value (shortcut):
$s = app(Smorken\Settings\Contracts\Storage\Setting::class);
$s->set('foo.key', 'value');
setting()->set('foo.key', 'value');
\Smorken\Settings\Facades\Setting::set('foo.key', 'value');