Layouts

Creating Layouts

Create a layout when multiple templates should share the same outer page shell.

Location#

Layouts live in resources/views/layouts:

phpresources/views/layouts/default.php
<!doctype html><html><head>  <meta charset="UTF-8">  <meta name="viewport" content="width=device-width, initial-scale=1.0">  <link rel="stylesheet" href="main.css"></head><body>  <div id="page">    {{ slot }}  </div></body></html>

The wrapper around {{ slot }} is normal theme markup. Use the classes, landmarks, and structure that fit the site.

Multiple Layouts#

You can create more than one layout file:

        • default.php
        • landing.php
        • auth.php

Each layout can have its own shell, assets, and shared partials.