« first day  last day (15 days later) » 

3:03 PM
ahahahah yes lol... I have a question please ^^
I have 2 roles in my Pannel "Admin" and "Former"
If the user who has the role "Former" is connected, It should only see the "Train" section and not the "Admin" section.
* sorry the rubric "Formers" and not the "Admin" section.
I want to hide the rubric admin when the user former is connected
I have tried this
<li class="px-nav-item">
@if(in_array("Admin", Auth::user()->roles->toArray()))
<a href="/admins"><i class="px-nav-icon ion-grid"></i><span class="px-nav-label">Listing admin</span></a>
@endif
</li>

<li class="px-nav-item">
@if(in_array("Moniteur", Auth::user()->roles->toArray()))
<a href="/formers"><i class="px-nav-icon ion-grid"></i><span class="px-nav-label">Listing formers</span></a>
@endif
</li>
my rubrics are gone
I have tested @dd(Auth::user()->roles->toArray());
array:1 [▼
0 => array:5 [▼
"id" => 1
"name" => "Admin"
"created_at" => "2019-08-11 12:22:32"
"updated_at" => "2019-08-11 12:22:32"
"pivot" => array:2 [▼
"user_id" => 1
"role_id" => 1
]
]
]
I don't found the problem??? :-(
Do you have an idea please???
 

« first day  last day (15 days later) »