php - how to check one field with two values in laravel 4.2 -
$input = input::all(); $user = user::where(function($q) { $q->where('email', $input['email'] ) ->orwhere('email', $input['emails'][0]['value'] ); }) ->first(); print_r($user);die; always says undefined variable: input best way compare email 2 values please guide
add use($input) pass $input variable closure scope:
user::where(function ($q) use ($input) { closures may inherit variables parent scope. such variables must passed
uselanguage construct.
Comments
Post a Comment