I'm newbie in laravel. When I try to make master layout example, I get the content of my view printed out twice.
master.blade.php:
<html>
<head>
<title>@yield('title')</title>
</head>
<body>
@section('sidebar')
This is the master sidebar.
@show
<div class="container">
@yield('content')
</div>
</body>
</html>
page.blade.php:
@extends('layouts.master')
@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
and my Route web.php:
Route::get('blade', function () {
return view('page');
});
I trying use @stop intead of @endsection but it doesn't work.