Basic Usage

Basic Usage

{note} You're browsing the documentation for an old version of laravel-settings. Consider upgrading your project to v3. Check your version with the following command:

composer show rawilk/laravel-settings

You can interact with settings via the Settings facade, or by using the settings() helper function, which returns an instance of Rawilk\Settings\Settings.

// Create a new setting
Settings::set('foo', 'bar');

// Update an existing setting
Settings::set('foo', 'updated value');
Settings::get('foo');

// Retrieve a non-persisted setting
Settings::get('not persisted', 'my default'); // 'my default'
Settings::has('foo');
Settings::forget('foo');
Settings::set('app.debug', true);

Settings::isTrue('app.debug'); // true
Settings::isFalse('app.debug'); // false

Settings::set('app.debug', false);
Settings::isFalse('app.debug'); // true
Previous
Changelog
Caught a mistake? Suggest an edit on GitHub