Level 60
@if(auth()->user()->role_id == 2 || auth()->user()->role_id == 7)
<p>RED</p>
@endif
@if(auth()->user()->role_id == 2 || auth()->user()->role_id == 8)
<p>BLUE</p>
@endif
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
here my code
@if(auth()->user()->role_id == 2 || auth()->user()->role_id == 7)
<p>RED</p>
@elseif(auth()->user()->role_id == 2 || auth()->user()->role_id == 8)
<p>BLUE</p>
@endif
my code output is only show "RED" when i logged with role_id == 2
what i need is:
@if(auth()->user()->role_id == 2 || auth()->user()->role_id == 7)
<p>RED</p>
@endif
@if(auth()->user()->role_id == 2 || auth()->user()->role_id == 8)
<p>BLUE</p>
@endif
Please or to participate in this conversation.