public findMenuByName ( string $name ) : array | ||
$name | string | Human readable name of link |
return | array |
public function findMenuByName($name)
{
$menu = $this->Menu->with('items.children')->whereName($name)->firstOrFail();
if ($this->currentLanguage->id != $this->LanguageDetector->primaryLanguageId()) {
$menu = $this->getTranslation($menu);
}
return $menu;
}