<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ $title ?? 'My Laravel App' }}</title>
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
</head>
<body>
<header>
<x-header />
</header>
<main>
{{ $slot }}
</main>
<footer>
<x-footer />
</footer>
<script src="{{ asset('js/app.js') }}"></script>
</body>
</html>
In this component-based layout, the layout itself is a Blade component. It includes dynamic content placeholders such as $slot
, which will be replaced by the child view’s content.