Hi,
I have the following view composer
public function boot()
{
view()->composer(['suggested-activities'], '\App\Http\Composers\Frontend\Activities\SuggestedActivitiesComposer@compose');
}
class SuggestedActivitiesComposer
{
public function compose(View $view)
{
$view->with('activities', $this->doSomeAwesomeStuff($view->getData()['MYVARIABLE']) );
}
public function doSomeAwesomeStuff($somevar)
{
...
}
}
How can I get MYVARIABLE variable from the controller? OR from the view?
In my view I tried to add in my view
@include('suggested-activities', ['MYVARIABLE' => $content->id])
but that does not work ...
I don't mind getting the value from the controller if that's easier but it feels more logical to me to get the value from the view