Example:
I have Users Table.
There are Patients, Doctors and all other users in it based on role user table.
I have an Appointment Table.
Where patient_id, doctor_id these forign_ids belongs to User Table.
When I create a Livewire Datatable I am having issue Retrieving the Data When It is duplication the username on Doctor Name if Patient Name is given First.
public function patient()
{
return $this->belongsTo(User::class, 'patient_id');
}
public function doctor()
{
return $this->belongsTo(User::class, 'doctor_id');
}`
Example: I have Users Table. There are Patients, Doctors and all other users in it based on role user table.
I have an Appointment Table. Where patient_id, doctor_id these forign_ids belongs to User Table.
When I create a Livewire Datatable I am having issue Retrieving the Data When It is duplication the username on Doctor Name if Patient Name is given First.
If I Check the Direct Query Data.
It is working perfectly.
Don't Know Whet the Issue is, Please Check.
LiveWire Table Code: `public $model = OpdPatient::class; public $exportable = true;
Model Code: `protected $fillable = [ 'patient_id', 'doctor_id', 'date', 'time', 'description', ];
Table Screen Shot:![image](https://user-images.githubusercontent.com/55267488/199206865-0327fb2e-e279-43a6-8237-7136ec431cf6.png)
Edit Screen Shot:![image](https://user-images.githubusercontent.com/55267488/199206934-b589799e-c5b2-47dc-9d5d-65cb8a30a2e9.png)
Please Help Me Out...