This does create a new contact when i fill in the needed fields, but it does not attach that contact to my User.
User Model:
public function contact(): HasOne { return $this->hasOne(Contact::class, 'id', 'contact_id'); }
public function contact(): HasOne { return $this->hasOne(Contact::class, 'id', 'contact_id'); }
Contact Model:
public function user(): BelongsTo { return $this->belongsTo(User::class, 'contact_id', 'id'); }
public function user(): BelongsTo { return $this->belongsTo(User::class, 'contact_id', 'id'); }
My users table has an
contact_id
contact_id
field which should be filled with the created contact. But it isn't. I think the issue is somewhere in my code but for the love of me im not able to see it.