Answer the question
In order to leave comments, you need to log in
How to correctly implement data transfer to the parent Blade template?
index.blade.php
@extends('layouts.site')
@section('content')
{{ $data }}
@endsection
layouts/site.blade.php
<main class="py-4">
{{ $data }}
@yield('content')
</main>
index.blade.php
tolayouts/site.blade.php
Answer the question
In order to leave comments, you need to log in
You don't have to move anything. The data is already available in the parent template.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question