Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function index()
- {
- $user = Auth::user();
- // $user = User::find(1);
- $applicants = $user->applicants->where('visible', 1);
- foreach ($applicants as $applicant) {
- $applicant->bloodGroup;
- $applicant->fiqa;
- $applicant->gender;
- }
- // return response()->json($applicants);
- return view('applicants.index', ['applicants' => $applicants]);
- }
- {
- "1": {
- "id": 4,
- "blood_group_id": 1,
- "created_at": "2019-04-22 13:24:16",
- "updated_at": "2019-04-26 10:21:41",
- "blood_group": {
- "id": 1,
- "name": "A+",
- "visible": 1,
- "created_at": "2019-04-22 08:21:19",
- "updated_at": "2019-04-22 08:21:19"
- }
- }
- }
- <div class="row mx-4">
- <div class="col-06 pr-3">
- <p class="h5">Name:</p>
- </div>
- <div class="col-06">
- <p><?php echo e($applicant->blood_group->name); ?></p>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement