How to store foreign key in import action?

I am trying to store the foreign key in a import action without success, but I don't know why.
This should be possible right?

This is the code
public function resolveRecord(): ?Client
    {
        return Client::firstOrNew([
            'user_id' => Auth::user()->id,
            'email' => $this->data['email'],
        ], [
            'user_id' => Auth::user()->id,
            'firstname' => $this->data['firstname'],
            'lastname' => $this->data['lastname'],
        ]);
    }
Was this page helpful?