Jishad
Jishad

Reputation: 89

Blade Layout in Laravel is not working

I have blade template namely default.blade.php in app/layout/ folder

<!doctype html>
<html>
    <head>
        @include('includes.head')
    </head>
    <body>
        <div class="container">
            <header class="row">
                @include('includes.header')
            </header>

            <div id="main" class="row">
                @yield('content')
            </div>

            <footer class="row">
                @include('includes.footer')
            </footer>
        </div>
    </body>
</html>

Folder structure:

app/views/layout/default.blade.php
app/views/includes/footer.blade.php
app/views/includes/head.blade.php
app/views/includes/header.blade.php

My controller namely blade.php

<?php
    class Blade extends BaseController
    {
        public function layout()
        {
            return View::make('layout.default');
        }
    }
?>

Routes.php

Route::get('blade','Blade@layout');

I am pointing my controller in browser like:

http://localhost/laravel/public/blade

It is showing error:

Call to undefined method Illuminate\Support\Facades\Blade::getAfterFilters() 

How can i fix it. Please help me.

Upvotes: 0

Views: 809

Answers (1)

Sebastian Kraft
Sebastian Kraft

Reputation: 119

You can't name your Controller BLADE, Blade is a facade for the Template engine in Laravel, rename your Controller, to something else then Blade.

you can find all Laravel internal Facades in your config\app.php at the key aliases

Upvotes: 2

Related Questions