caffeinated / menus

:pushpin: Menu generator package for the Laravel framework
https://caffeinatedpackages.com
132 stars 59 forks source link

Menu not found #73

Closed windhorst closed 8 years ago

windhorst commented 8 years ago

I'm sure I'm just missing something silly but I haven't been able to figure out what it is yet.

Middleware:

namespace App\Http\Middleware;
use Closure;
use Caffeinated\Menus\Menu as Menu;
class MenuWare
{

Usage inside a method in my middleware class:

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');
            });

Providers added as: 'Caffeinated\Menus\MenusServiceProvider',

Alias added as: 'Menu' => 'Caffeinated\Menus\Facades\Menu',

I get a "Class 'Menu' not found" error. The rest of my code is the same as the original post.

windhorst commented 8 years ago

I figured it out finally!! It was a combination of needing to use composer dump-autoload, artisan cache:clear, artisan config:clear, and installing the laravelcollectiveHtml service provider and then poof, they worked!

kaidesu commented 8 years ago

awesome man :+1: