I am trying to refer variable inside
@include('partial', ['somevar' => $var, 'otherVar' => $otrVar]);
But it gives
Undefined variable: somevar
while accessing $someVar in the partial view?
Have you checked spelling of the variables? Because here you wrote somevar and $someVar.
Apparently the issue was I had some instances of @include where I havent passed these variables.
like:
@include('partial');
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community