Challenge 2: Build a Layout + Two Child Views — Possible Solution ====================================================================
{{ $book->description }}
← Back to all books @endsection WHY THIS WORKS -------------- - @yield('title', 'My Library') in the layout declares a placeholder with a DEFAULT value ('My Library') — a child view that never defines a 'title' section would still render a sensible title, rather than a blank one. - Both child views @extends('layouts.app') and fill in the SAME two named sections (title and content) with entirely different content — the layout never needs to know or care what any specific page puts into those sections. - books/show.blade.php's title section uses PHP string concatenation ($book->title . ' — Book Details') directly inside the @section() call — Blade sections can contain ordinary PHP expressions, not just static text, so the page title becomes dynamic per book. - The route('books.index') helper in books/show.blade.php reuses the named-route pattern from Chapter 2 rather than hardcoding "/books" directly — the same discipline the Django course applied with {% url %}.