can you please use laravel session as for now you are using core php session for more detail please visit the below url
@extends Test
Hi, i wanted to do a test for wich template i will use depending on user role ..
so i did this
@if($_SESSION["role"] == 'Superviseur') @extends('layouts.superviseur') @elseif($_SESSION["role"] == 'administrateur') @extends('layouts.master') @endif
in this case all the templates are included in the same time
i tried to break after each @extends a i get this error
Cannot break/continue 1 level
Help me please
@Screenbeetle i asked this question because i have 4 types of sidebar navigation one for Superviser one for admin .. etc .. i found a solution .. instead of creating 4 templates i did my test in the sidebar itself .. if the session role is admin then charge admin sidebar elements
@if(Session::get('role') == 'administrateur') "li" blabla "/li" @if(Session::get('role') == 'superviseur') "li" bla bla "/li"
and it works great :)
thank you all for helping me
Please or to participate in this conversation.