Laravel-modules: Extending from master layout(view)

Created on 10 Dec 2016  路  5Comments  路  Source: nWidart/laravel-modules

I just discovered this package. It's awesome but how can I extend a layout view from a child view. Since each module has its own views folder, I would like to have a master layout that can be extended by all other views in each module. How is this possible?

Most helpful comment

Hi @abiodunjames You can create a Core module. Then add the views to the core module. Then have your view files in other modules extend it. @extends("core::layout.main")

All 5 comments

If you put a view into Laravel's original resources/views directory, you can still access it from anywhere like normal. Just omit the namespace part. (E.g. the part before ::, as well as the double colon.)

Hi @abiodunjames You can create a Core module. Then add the views to the core module. Then have your view files in other modules extend it. @extends("core::layout.main")

@mikemand Nice one. I did that it worked. @adelowo Thanks

Is there any way to extend the view from laravel root views directory? I don't really like the "core module" approach

I believe you can just use @extends("layout.main") in that case.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bashet picture bashet  路  19Comments

Alercard picture Alercard  路  29Comments

FoksVHox picture FoksVHox  路  11Comments

kamov picture kamov  路  10Comments

elephantux picture elephantux  路  11Comments