1

Suppose, I have two tables; tableA and tableB. For tableA single row's id there are multiple rows in tableB.

tableA

tableB

Now I want all tableA data including tableB, that's matches by id (tableA->id === tableB->blood_request_id)

The return will be

[
 ...tableA data,
 'blood_request_id' => [1, 2]
]
Ebrahim Khalil Amid
  • 398
  • 1
  • 4
  • 12
  • sounds like a ```hasMany``` and ```belongsTo``` basic relationship, did you check https://laravel.com/docs/8.x/eloquent-relationships ? – silver Jul 03 '22 at 12:54

0 Answers0