src/Settings/Settings.php
public static function get($name, $for_id = null)
    {

        // Pickup the value from the cache if we can. Otherwise,
        // read the value for the database and cache it for next
        // time.
        return Cache::rememberForever(self::get_key_prefix($name,
            self::get_affected_id($for_id)), function () use ($name, $for_id) {

            // Init a new MODEL
            $value = (new static::$model);

            // If we are not in the global scope, add a constraint
            // to be user group specific.
            if (static::$scope != 'global')
                $value = $value->where('group_id', self::get_affected_id($for_id));

            // Retrieve the value
            $value = $value->where('name', $name)
                ->value('value');

            if ($value)
                return json_decode($value);

            // If we have no value, check if we can return
            // a default setting
            if (array_key_exists($name, static::$defaults))
                return static::$defaults[$name];

            return null;
        });
    }
public static function get($name, $for_id = null)
    {

        // Pickup the value from the cache if we can. Otherwise,
        // read the value for the database and cache it for next
        // time.
        return Cache::rememberForever(self::get_key_prefix($name,
            self::get_affected_id($for_id)), function () use ($name, $for_id) {

            // Init a new MODEL
            $value = (new static::$model);

            // If we are not in the global scope, add a constraint
            // to be user group specific.
            if (static::$scope != 'global')
                $value = $value->where('group_id', self::get_affected_id($for_id));

            // Retrieve the value
            $value = $value->where('name', $name)
                ->value('value');

            if ($value)
                return json_decode($value);

            // If we have no value, check if we can return
            // a default setting
            if (array_key_exists($name, static::$defaults))
                return static::$defaults[$name];

            return null;
        });
    }
public static function get ( $ name , $ for_id = null ) { // Pickup the value from the cache if we can. Otherwise, // read the value for the database and cache it for next // time. return Cache :: rememberForever ( self :: get_key_prefix ( $ name , self :: get_affected_id ( $ for_id ) ) , function ( ) use ( $ name , $ for_id ) { // Init a new MODEL $ value = ( new static :: $ model ) ; // If we are not in the global scope, add a constraint // to be user group specific. if ( static :: $ scope != 'global' ) $ value = $ value -> where ( 'group_id' , self :: get_affected_id ( $ for_id ) ) ; // Retrieve the value $ value = $ value -> where ( 'name' , $ name ) -> value ( 'value' ) ; if ( $ value ) return json_decode ( $ value ) ; // If we have no value, check if we can return // a default setting if ( array_key_exists ( $ name , static :: $ defaults ) ) return static :: $ defaults [ $ name ] ; return null ; } ) ; }
Retrieve a setting by name.

@param      $name
@param null $for_id

@return mixed
@throws \Seat\Services\Exceptions\SettingException
Retrieve a setting by name .