Something in blade is clearing my Session, why I don't know
I have a rpg pattern search system. When user enters the page select station and date then starts search, then it posts to search method, after business inside search method, i can transfer all data to the session and recirect to get methods of search then take all data from session then create view with those variables.
I found that something in blade breaks my session, clears it and i got invalid supply in foreach error.
Have you encountered with this kind problem before? I don't know what to do... I can share my view if you want to help..
I think this line causes the poblem, I went step by step removed everything inside blade template. But this is clearing my session data. Whats problem I dont know
Its very unlikely that something in blade will clear the session, especially at the point it is rendering the template. Remember, you have already copied your session to your local variables at this time
Most likely issue is that one of the variables in your foreach loop is missing a relation.
lets change this line for starters;
<img class="img-responsive" src="{{asset('images/vehicles/'.$v->group->name.'/'.$v->in_station->picture) or '---'}}" alt="">
No, there is nothing wrong with your image tag, but it pays to be defensive and code for the possibility that $v does not contain in_station or in_station does not contain picture
You can dd() the variables and all will look ok, but this is stopping on the first pass. Often its one of the $v's later in the loop that is missing something
When the first time i search it loads all cars and lists to me in blade. When i refresh the page it says invalid supplied on foreach and by the way session token has been changed.