Sunday, March 12, 2017

Laravel: Authentication and Roledependent include

First Laravel Project. I want to achieve this logic in authentication:

Check if user logged in
 - If no: go to log in screen (views/auth.login)
 - If yes: check his role
    - if admin: Load admin navbar
    - if user: Load user navbar

For Login I want to use login.blade.php and for "index" I want to use index.blade.php

And in layouts.master's body I have a section with "nav" class and in this section I want to include an admin or user menu what depends of user role.

What's the best method?



via Feralheart

Advertisement