flashz
2293
22
Laravel

Blade template just not working

Posted 2 years ago by flashz

I copied it exactly from Laravel documentation. My child.blade.php:

@extends('layouts.application')

@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

My application.blade.php:

<html>
    <head>
        <title>App Name - @yield('title')</title>
    </head>
    <body>
        @section('sidebar')
            This is the master sidebar.
        @show

        <div class="container">
            @yield('content')
        </div>
    </body>
</html>

In web:

Route::get('blade', function () {
    return view('child');
});

However, when I visit the URL it just shows me: @extends('layouts.application') in plain HTML text?!

https://gyazo.com/2938c6bd3dc19ebeabaacb680ae4b234

Please sign in or create an account to participate in this conversation.