【/components/layout.blade.php】
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>{{ $title }}</title>
<link rel="stylesheet" href="{{ url('css/style.css') }}">
</head>
<body>
<div class="container">
{{ $slot }}
</div>
</body>
</html>
【/views/index.blade.php】
<x-layout>
<x-slot name="title">
My BBS
</x-slot>
<h1>My BBS</h1>
<ul>
@forelse ($posts as $index => $post)
<li>
<a href="{{ route('posts.show', $index) }}">
{{ $post }}
</a>
</li>
@empty
<li>No posts yet!</li>
@endforelse
</ul>
</x-layout>
参考:ドットインストール「Laravel 8入門 基本機能編」