Prevent exception if the requested Option does not exist

This commit is contained in:
Bubka 2020-11-17 21:59:07 +01:00
parent fc05d41120
commit b113109340

View File

@ -32,7 +32,12 @@ public static function get($option = null)
// fallback values for every options
$options = collect(config('app.options'))->merge($userOptions);
return !is_null($option) ? $options[$option] : $options;
if( $option ) {
return isset($options[$option]) ? $options[$option] : null;
}
return $options;
}