Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top