Recently when I was working in Laravel, I came across an issue. It was regarding the selection of a particular layout as per the logged-in user. I have to show a particular layout according to the role of the user logged-in. When I used extends($layout) in if condition some how all the layout got included and hence I came out with an alternative solution.
To overcome the above stated problem follow the following procedure.