Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Laravel yield is empty

I have a master blade file that includes some other blade files and yields content of a blade file called home which I extend on this master blade, I can click on master from my home blade in phpstorm and it takes me to the correct file, so they must be connected correctly.

The problem is the contents are not loaded, it just loads the head/header and footer but nothing from my home.blade.

My master.blade.php:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

<!doctype html>
<html lang="en">
@include('partials.head')
<body>

@include('partials.header')
@yield('content')
@include('partials.footer')
</body>
</html>

In my home.blade.php

@extends('master')
@section('title', 'Home')
@section('content')
<main id="content">
    test
</main>
@endsection

It loads everything correctly except the content section. What am I doing wrong?

Only route I got:

Route::get('/', function () {
    return view('master');
});

>Solution :

You have to change the view of the route,

Route::get('/', function () {
    return view('home');
});
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading