Basic Usage

Introduction

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

Setting a value

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

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

Retrieving a value

Settings::get('foo');

// Retrieve a non-persisted setting
Settings::get('not persisted', 'my default'); // 'my default'

Check if a setting exists

Settings::has('foo');

Remove a setting from storage

Settings::forget('foo');

Boolean settings

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 Topic

Changelog

Next Topic →

Contextual Settings

Caught a mistake? Suggest an edit on Github