How do I load page specific resource(s) using @include
of the Laravel blade template engine?
Below is the content of my Master layout (master.blade.php
):
<head>
@section('styles')
{{-- Some Master Styles --}}
@show
</head>
<body>
{{-- Header --}}
@section('header')
@include('header')
@show
{{-- Content --}}
@section('content')
{{-- Content for page is extending this view --}}
@show
{{-- Footer --}}
@section('footer')
@include('footer')
@show
</body>
In a given page, I make use of my master template this way:
@extends('master')
@section('styles')
@parent
{{-- Page Stylesheet --}}
@endsection
The approach above is what I use to try and load my page specific style to the <head>
section.
It does not work properly as expected.
I would like to as well load other page specific resource(s) in my footer using the same approach; how can I do that effectively?