Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Mithridates's avatar

@include and @section differences

In Blade template engine, what's the main difference in using master pages with @extends and @section vs using @include? since both just loads some code to another file.

0 likes
1 reply
pmall's avatar
pmall
Best Answer
Level 56

Extends is for extending a layout file with sections that can be replaced by child template values. The child extends the parent and overrides some parts.

Include has no sections, and is just a partial file that can be included in many files. The parent include the child.

Classic organization : layout file > main template which extends the layout and overrides some section > partials file which get included by the main template.

1 like

Please or to participate in this conversation.