Guest User

Untitled

a guest
Aug 19th, 2019
67
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2. "email": "shah",
  3. "name": "shah",
  4. }
  5.  
  6. {
  7. "email": "shah",
  8. "name": "shah",
  9. "offset": 1,
  10. "paginate": 1
  11. }
  12.  
  13. $pram = $request->name;
  14. $email= $request->email;
  15. $roleId= $request->role_id;
  16.  
  17. $results = User::where('email','like', '%' . $email . '%')
  18. ->WhereHas('userBasicInfo', function ($query) use ($pram) {
  19. $query->where('first_name', 'like', '%' . $pram . '%')
  20. ->orWhere('middle_name', 'like', '%' . $pram . '%')
  21. ->orWhere('last_name', 'like', '%' . $pram . '%');
  22. })->with(['userBasicInfo' => function ($query) use ($pram) {
  23. $query->where('first_name', 'like', '%' . $pram . '%')
  24. ->orWhere('middle_name', 'like', '%' . $pram . '%')
  25. ->orWhere('last_name', 'like', '%' . $pram . '%');
  26. }])->get()->toArray();
RAW Paste Data