Support the ongoing development of Laravel.io →
Views Blade Requests

Ok so here is my code

@if(some logic)
....@extends('template.master')
  ....@section('title')
....title
...  @stop
....  @section('content')
....content
.....@stop

@else('second Logic)
....
....@extends('template2.master')
  ....@section('title')
....title2
...  @stop
....  @section('content')
....content2
.....@stop

Well if 1condition is true then 1st template will load if other is true then 2nd template will load. it is possible with @if conditions in blade?

Last updated 2 years ago.
0

Try it and see.

0

should work

0

Sign in to participate in this thread!

Eventy

Your banner here too?

debjit debjit Joined 22 Aug 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.