M
M
maaestr02022-04-08 21:35:56
Laravel
maaestr0, 2022-04-08 21:35:56

Laravel Parent Variable Inheritance?

Hello I have the following project structure.
base.blade.php

@section('info-blocks')
    @include('admin.components.general-info', ['title' => 'title 1' , users'=> $users])
     @include('admin.components.general-info', ['title' => 'title 2' , users'=> $users])
    ///.....
@endsection


There is a template that is inherited from this view. But it does not see the $users, title ... variable.
In the documentation, I found how to make the variable public in all views of the project.
https://laravel.com/docs/9.x/views#sharing-data-wi...

But is there any way to inherit from the parent. I would be grateful for any advice.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
maaestr0, 2022-04-09
@maaestr0

It's decided.
https://laravel.com/docs/9.x/views#sharing-data-wi...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question