Fill base view data only once

Asked

Viewed 33 times

1

I have a view base that has a several dropdowns which depend on database values, calling it "base.blade.php".

I also have several other views that extend from this base, for example: depoimentos.blade.php, contato.blade.php etc. This way, views need to have these dropdowns, as well as have their own data, in addition to the data needed in the base view, so that in Depoimentoscontroller, Contactoscontroller and etc, you can pass the data from the base view and view.

But suppose I have 10 more pages, I’ll have to add the base view data to all controllers.

Is there any other way for me to fill out the database view data once?

  • have a look at this lara manual https://laravel.com/docs/5.5/blade

  • 1

    I ended up resolving using Windows view, thank you!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.