Ok, so I have about 4 fields that are supposed to be global on the entire site. I thought of having a public function on the App.php controller that returns an object with those 4 ACF variables so they can be called from whatever view php file.
This is the App.php code
public function globalAcf()
{
return (object) array(
'phone_Number' => get_field('phone_number', 'option'),
'state' => get_field('state', 'option'),
'city' => get_field('city', 'option'),
'zipcode' => get_field('zipcode', 'option')
);
}
On the view, I am planning to just call these variables as
<h2> {{ $globalAcf -> zip }} </h2>
but of course, it doesn’t work. I am trying to figure out why and I am sure it’s because of some stupid obvious reason but as you can tell I am not that experienced.