user742736
user742736

Reputation: 2729

Blade templating

Is it possible to have the master.blade.php file outside of the template files.

Example below:

views/
     master.blade.php
     layout/
           hello.blade.php

views/layout/hello.blade.php

@extends('layout.master)

I have tried the above but it cannot find the master.blade.php file. So is there a way to refer to a directory above the blade file.

Upvotes: 0

Views: 106

Answers (1)

warspite
warspite

Reputation: 632

it would be

@extends('master')

the "." in the view names indicate folders. so

@extends('my.long.path.to.template')

would be found in:

/views/my/long/path/to/template.blade.php

layouts don't have to be in a folder called layouts

Upvotes: 2

Related Questions