Normally I would never simply link to a video but this is so recent you may not have seen it. Lesson #2 in this video talks about permissions in Blade. :) https://laracasts.com/series/whats-new-in-laravel-5-1/episodes/16
Sep 14, 2015
2
Level 33
Laravel using roles in view
Right now I've this in my navbar.blade.php:
@if (Auth::check())
<li><a href="users/logout">Uitloggen</a></li>
@else
<li><a href="/public/users/login">Inloggen</a></li>
<li><a href="/public/users/register">Registreer</a></li>
@endif
Now I've made a middleware called UserRoles.php and in here I can check for example if someone is an admin.
But how can I use this in my view for showing specific things in the navbar. For example an admin has a menu item: "show users", but a normal user hasn't. I know you can use middleware in your routes.php file or in your controllers constructor but I can't figure out how this works in my view.
Please or to participate in this conversation.