Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save calvez/6f80a10d69fcb8fcbc17b4ceecce069e to your computer and use it in GitHub Desktop.
Save calvez/6f80a10d69fcb8fcbc17b4ceecce069e 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();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment