Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. public function index()
  2. {
  3. $user = Auth::user();
  4.  
  5. // $user = User::find(1);
  6. $applicants = $user->applicants->where('visible', 1);
  7.  
  8. foreach ($applicants as $applicant) {
  9. $applicant->bloodGroup;
  10. $applicant->fiqa;
  11. $applicant->gender;
  12. }
  13. // return response()->json($applicants);
  14. return view('applicants.index', ['applicants' => $applicants]);
  15. }
  16.  
  17. {
  18. "1": {
  19. "id": 4,
  20. "blood_group_id": 1,
  21. "created_at": "2019-04-22 13:24:16",
  22. "updated_at": "2019-04-26 10:21:41",
  23. "blood_group": {
  24. "id": 1,
  25. "name": "A+",
  26. "visible": 1,
  27. "created_at": "2019-04-22 08:21:19",
  28. "updated_at": "2019-04-22 08:21:19"
  29. }
  30. }
  31. }
  32.  
  33. <div class="row mx-4">
  34. <div class="col-06 pr-3">
  35. <p class="h5">Name:</p>
  36. </div>
  37. <div class="col-06">
  38. <p><?php echo e($applicant->blood_group->name); ?></p>
  39. </div>
  40. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement