Skip to content
This repository has been archived by the owner on Jun 26, 2022. It is now read-only.

How to Use it ?

Antoine edited this page Mar 22, 2017 · 2 revisions

Set a value

Settings::set('key', 'value');

Get a value

$value = Settings::get('key');

Get a value with Default Value.

$value = Settings::get('key', 'Default Value');

Note: If key is not found (null) in cache or settings table, it will return default value

Get a value via an helper

$value = settings('key');
$value = settings('key', 'default value');

Forget a value

Settings::forget('key');

Forget all values

Settings::flush();

Fallback to Laravel config

// Change your config/settings.php
'fallback'   => true

Example

/*
 * If the value with key => mail.host is not found in cache or DB of Larave Settings
 * it will return same value as config::get('mail.host');
 */
Settings::get('mail.host');

Note: It will work if default value in laravel setting is not set