1<!-- Stored in resources/views/layouts/master.blade.php -->
2
3<html>
4 <head>
5 <title>App Name | @yield('mytitle')</title>
6 </head>
7 <body>
8 <div class="container">
9 @yield('content')
10 </div>
11 </body>
12</html>
13
14<!-- Extending the master.blade.php into another view file. Eg. About Us Page -->
15
16@extends('layouts.master')
17
18@section('mytitle', 'About Us')
19
20@section('content')
21 <h1>"Let's Go"</h1>
22@endsection
1<html>
2<head>
3 <title>App Name - @yield('title')</title>
4</head>
5<body>
6 @section('sidebar')
7 This is the master sidebar.
8 @show
9
10 <div class="container">
11 @yield('content')
12 </div>
13</body>
14
15<!-- Then you can extend pages using code below as guide -->
16
17 @extends('layouts.master')
18
19 @section('title', 'Page Title')
20
21 @section('sidebar')
22 @parent
23 <p>This is appended to the master sidebar.</p>
24 @endsection
25
26 @section('content')
27 <p>This is my body content.</p>
28 @endsection
1<html>
2<head>
3 <title>App Name - @yield('title')</title>
4</head>
5<body>
6 @section('sidebar')
7 This is the master sidebar.
8 @show
9
10 <div class="container">
11 @yield('content')
12 </div>
13</body>
14
15
16 @extends('layouts.master')
17
18@section('title', 'Page Title')
19
20@section('sidebar')
21@parent
22
23<p>This is appended to the master sidebar.</p>
24@endsection
25
26@section('content')
27<p>This is my body content.</p>
28@endsection
29