I am trying to pass data to my blade views. Normally, in laravel you would just pass the data along with the view that you are calling to display.
In sage, as far as I understand you add a filter in app\filters.php.
An example is shown in the code block in this doc https://roots.io/sage/docs/blade-templates/
But my question is… How to I access/reference the data from my blade templates. For example
add_filter('sage/template/page/data', function (array $data) {
$data['header_image'] = get_field('header_image');
$data['header_content'] = get_field('header_content');
$data['key'] = 'VALUE';
return $data;
});
In my blade template I have tried {{$data[‘key’]}} {{$key}} {{$data->key}}… None of these work… None of these output ‘VALUE’ on my page.