I'm trying to extend different layouts inside if-else statement. Here is my code:
@if(Auth::check())
@extends('layouts.adminPanel')
@else
@extends('layouts.home')
@endif
But the view files extending both layouts. No matter user logged in or not!
How can I fix it?
Add Extends at the first line
@extends(\Auth::check() ? 'layouts.adminPanel' : 'layouts.home')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With