Skip to content
Advertisement

Laravel eloquent advanced where clause: variables not defined | I use use()

I have this code:

I get an error: Undefined variable: to.

I have found many topics, but the fix is always to use use(). But it still tells me the variable is not defined.

For example this works perfectly:

Advertisement

Answer

There are two closures, you missed at one. Check orWhere

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