Closed windhorst closed 8 years ago
Get rid of the use Caffeinated\Menus\Menu as Menu;
line and simply replace it with use Menu;
.
Thanks for the help. I can't believe I missed that.
Well, I thought that had indeed fixed things but it turns out I was in a conditional that simply didn't hit that code block. I switched the use statement to use Menu, however when I try to call
Menu::make('PublicMenu', function($menu){
$menu->add('Features', '/pages/features');
$menu->add('Support', '/pages/support');
$menu->add('Libraries', '/pages/libraries');
$menu->add('Publishers', '/pages/publishers');
$menu->add('FAQ', '/pages/faq');
$menu->add('Subscribe', '/subscribe');
$menu->add('Contact', '/pages/contact');
$menu->add('Login', '/pages/login');
});
I get a "Class 'Menu' not found" error. The rest of my code is the same as the original post.
Whenever I try to use this package I am getting a "Non-static method Caffeinated\Menus\Menu::make() should not be called statically, assuming $this from incompatible context" error. I'm fairly sure it is something that I can doing wrong but I have yet to figure out what it is. Middleware:
Usage inside a method in my middleware class:
Providers added as:
'Caffeinated\Menus\MenusServiceProvider',
Alias added as:
'Menu' => 'Caffeinated\Menus\Facades\Menu',
Any help on this would be greatly appreciated.