I want to extend template based on condition. I know i can use @if @else
statement in blade. I am doing the same thing, but blade extending both the template. I don't know why.
@if(isset(Auth::user()->id))
@extends('layouts.adminlayout')
@else
@extends('layouts.default')
@endif
@section('content')
i am the home page
{{ isset(Auth::user()->id) }}
@stop
As, you can see i am checking whether or not user login-ed and then extend the template layout. But it is extending from both the layout.
Please help me.