Skip to content
Advertisement

Laravel : @foreach Undefined variable

i have error but in foreach :Undefined variable: infos that’s my View :

JavaScript

and my controller

JavaScript

Advertisement

Answer

You should pass parameters to the view like this:

JavaScript

What you’ve been doing before using with has a different effect, it flashes the data to the session. Check out this doc here

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement