mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-04-01 03:16:07 +02:00
Change Options getter to return a single option
This commit is contained in:
parent
8177a8f268
commit
fd3d016b80
@ -6,11 +6,11 @@ class Options
|
||||
{
|
||||
|
||||
/**
|
||||
* Build a collection of options to apply
|
||||
* Compile both default and user options
|
||||
*
|
||||
* @return Options collection
|
||||
* @return Options collection or a signle
|
||||
*/
|
||||
public static function get()
|
||||
public static function get($option = null)
|
||||
{
|
||||
// Get a collection of user saved options
|
||||
$userOptions = \Illuminate\Support\Facades\DB::table('options')->pluck('value', 'key');
|
||||
@ -32,7 +32,7 @@ public static function get()
|
||||
// fallback values for every options
|
||||
$options = collect(config('app.options'))->merge($userOptions);
|
||||
|
||||
return $options;
|
||||
return !is_null($option) ? $options[$option] : $options;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user