0

I am Using the Same Login Box and i am Differentiating the Users after Login using Auth::attempt() function. In my project i have only one Sidebar which Contains all the Menus that are required for my project.

I have Four Login roles namely Admin / Teaching Staff / Non-teaching Staff / Parent.

My doubt is that i need to display only some menus and related Blade(Views) that are inside that Sidebar Menu for different login users.

Screenshot Attachment: Click Here

I dont need to Redirect the Page based on the Login Users i need to alter my display based on Login Attempts.

I have not used any Packages for Authentication i am using only Auth::Login and Auth::attempt() functions.

Can you please provide me with a Solution of how to Get rid of This Error for Me.

Naresh Kumar P
  • 4,127
  • 2
  • 16
  • 33

1 Answers1

0

How i would do it is Auth::check() and then i would do if statement with elseif

So it would look like this

@if($User->Role == 1 )
    Nav Items for Admin 
@elseif($User->Role == 2)
    Nav items for Teaching Staff 
@elseif($User->Role == 3)
    Nav Items for Non-teaching Staff
@elseif($User->Role == 4)
    Nav Items for Parent
@endif
Skel
  • 1,611
  • 3
  • 16
  • 36