protected function when($condition, $value, $default = null)
    {
        return $condition
            ? value($value)
            : (func_num_args() === 3 ? value($default) : new MissingValue);
    }
protected function when($condition, $value, $default = null)
    {
        return $condition
            ? value($value)
            : (func_num_args() === 3 ? value($default) : new MissingValue);
    }
protected function when ( $ condition , $ value , $ default = null ) { return $ condition ? value ( $ value ) : ( func_num_args ( ) === 3 ? value ( $ default ) : new MissingValue ) ; }
Retrieve a value based on a given condition.

@param  bool   $condition
@param  mixed  $value
@param  mixed  $default

@return \Illuminate\Http\Resources\MissingValue|mixed
Retrieve a value based on a given condition .