Relationship not saved to Model on Section

In my UserResource i got a Section as followed:

  Section::make('Contactgegevens')
    ->relationship('contact')
    ->schema([...


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');
    }


Contact Model:
    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class, 'contact_id', 'id');
    }


My users table has an
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.
Was this page helpful?