Hello Devs, 

In this tutorial, we will learn Laravel Blade Section Inside Section Example.

Layouts are created via "template inheritance". This is the primary way of building the applications prior of the introduction of the components.


Here is a step-by-step guide for you. 


Defining A Layout:

resources/views/layouts/app.blade.php

<html>
    <head>
        <title>App Name - @yield('title')</title>
    </head>
    <body>
        @section('sidebar')
            This is the master sidebar.
        @show
        @section('main-content')
        <div class="container">
            @yield('content')
        </div>
        @endsection
    </body>
</html>

define a child page that inherits the layout.


Extending A Layout:

resources/views/child.blade.php

@extends('layouts.app')

@section('title', 'Page Title')

@section('sidebar')
    
    <p>This is appended to the master sidebar.</p>
@endsection

@section('content')
    <p>This is my body content.</p>
@endsection

May this example help you.