Level 2
I am not sure if it's technically correct, or if there is an easier more accepting way of doing it, but I was able to get it done with :
<? echo Menu::display('main'); ?>
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm trying to use the Voyager admin package to output a menu. When you use just:
Menu::display('main')
I get the TEXT. When I use it with curly brackets I get the code. When I use it with @yield I get nothing. So what is the proper use to make it output the menu?
with blade, double curly braces escape all html entities.
if you know that what you are echoing to the browser is safe, you can remove the protection by using {!!...!!}
{!! Menu::display('main') !!}
Please or to participate in this conversation.