#StackBounty: #php #laravel Laravel Layout For Different Users

Bounty: 100

So I have a few layouts in my Laravel app but the most common is and .

I have a shared route / view for the settings and password pages but want to use the same view inside different layouts depending on suer type.

/password – password.blade.php

@if(Auth::user()->type == 'business')
<x-business-layout>
@else
<x-app-layout>
@endif
    

    PAGE CONTENT HERE


@if(Auth::user()->type == 'business')
</x-business-layout>
@else
</x-app-layout>
@endif

This is how I thought I could dynamically change the layout depending on user but it doesn’t work. Just get syntax error, unexpected 'else' at the end of the file where I use that code again to close the layout off.

Any ways to do this?


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.