So you have a member_id in your member_notes table, right?
Have you checked if just the relation works at all?
I have a Member model which has a hasOne relationship with a MedicalNote model.
I want the ability to edit the medical note from within a form, so far I have:
Member class:public function medicalNote()
{
return $this->hasOne(MedicalNote::class);
}
$rules property for the EditMember livewire class:protected $rules = [
'member.medicalNote.note' => 'string'
];
edit-member.blade.php view:<input type="text" class="border-0 border-b border-gray-300 rounded py-1 text-sm col-span-4" wire:model="member.medicalNote.note"/>
I've been following the documentation set out here: https://laravel-livewire.com/docs/2.x/properties#binding-models
However, I think I may have overlooked something or am applying it incorrectly. When the Edit Member view loads, the Members' related medical note information is not appearing in the input element.
I appreciate any feedback!
Please or to participate in this conversation.