Layouts & Inheritance
Layouts & Inheritance
Section titled “Layouts & Inheritance”Prism layouts use @extends, @section, and @yield.
Yielding sections
Section titled “Yielding sections”<html> <head> <title>@yield("title", "Almasix")</title> </head> <body> @yield("content") @stack("scripts") </body></html>Extending a layout
Section titled “Extending a layout”@extends("layouts.app")
@section("title", "Home")
@section("content") <p>Welcome.</p> @push("scripts") <script src="{{ asset('home.js') }}"></script> @endpush@endsection@parent
Section titled “@parent”When a child overrides a section that an intermediate layout already defined,
@parent inserts the parent section’s content:
@section("content") @parent <p>Extra for this page.</p>@endsection