Skip to content

Commit

Permalink
Update Menu.php (#285)
Browse files Browse the repository at this point in the history
Fix for #284 when 'default' option array is not available.
  • Loading branch information
mertasan authored Feb 22, 2021
1 parent 8c63065 commit 4f14cb9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Lavary/Menu/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,14 @@ public function make($name, $callback, array $options = [])
public function loadConf($name)
{
$options = config('laravel-menu.settings');
$defaultOptions = isset($options['default']) ? $options['default'] : [];
$name = strtolower($name);

if (isset($options[$name]) && is_array($options[$name])) {
return array_merge($options['default'], $options[$name]);
return array_merge($defaultOptions, $options[$name]);
}

return $options['default'];
return $defaultOptions;
}

/**
Expand Down

0 comments on commit 4f14cb9

Please sign in to comment.