I want to implement Hero section inside header template
I use Sage 10, I’ve never worked with Laravel and that’s why I don’t quite understand how to work with View Composers
How it’s implemented now:
I created a file Fields/Hero.php
This displays ACF on the desired page
I created file Composers/Hero.php
This is where I get fields from ACF and pass them to the with() function.
Also in the array $views I list the blade templates
In the header.blade.php I check if Hero is on and connect the template
In the file hero.blade.php I already get data from Composers/Hero.php and output the layout
Interested in 2 and 3 point, everything is correct here? And how could it be done differently?