Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sharifbdp/e011ab55f12377f3c3520258131592d1 to your computer and use it in GitHub Desktop.
Save sharifbdp/e011ab55f12377f3c3520258131592d1 to your computer and use it in GitHub Desktop.
$type = $request->input('email_or_phone');
$user = UserVerify::where('user_id', $request->input('user_id'))
->where(function($query) use ($type, $request) {
if ($type == 1) {
return $query->where('email', $request->input('email'));
}
if ($type == 2) {
return $query->where('mobile_no', $request->input('mobile_no'));
}
})
->where('email_or_phone', $request->input('email_or_phone'))
->where('pin_code', $request->input('pin_code'))
->first();
@Dell791
Copy link

Dell791 commented Oct 15, 2020

$type = $request->input('email_or_phone');
this line of code is not working in my code in laravel 8.
how we could save 2 variable request in a single variable can any one explain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment