Reputation: 1998
master.blade.php
<div>
@yield('content')
</div>
index.blade.php
@extends('layouts.master')
@section('content')
<p>Foo</p>
@endsection
Folder structure
_layouts
__master.blade.php
_posts
__index.blade.php
When I do return view('layouts.master')
I get nothing. I'm expecting 'Foo' to be printed.
What am I doing wrong? Thanks.
Upvotes: 0
Views: 2905
Reputation: 33186
You need to return the index.blade.php
view, this is the view that is inheriting the layout.
return view('posts.index');
Upvotes: 1