Layouts

Slot

{{ slot }} is where the current template renders inside a layout.

phpresources/views/layouts/default.php
<body>  <Header />  {{ slot }}  <Footer /></body>

If front-page.php renders a <main>, that <main> appears where {{ slot }} is placed.

{{ slot }} is a value tag. Do not write {{ /slot }}.

Keep The Layout Around The Slot#

The layout owns the shell around the page:

phpresources/views/layouts/default.php
<body>  <div class="site">    {{ slot }}  </div></body>

The page template should stay focused on the page content.