Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

anonymouse703's avatar

Cannot store other data in Form Select relationship

Good day, in some modules it's working... but in this module is not working,, I want to add gender of the user but the userDetails is separate from users table

code

Resource

  Forms\Components\Select::make('detail.gender')
                                    ->label('Gender')
                                    ->required()
                                    ->options(Gender::array())
                                    ->placeholder('Select Gender'),

user model

 public function detail(): HasOne
    {
        return $this->hasOne(UserDetail::class, 'id');
    }

UserDetail

0 likes
1 reply
cgsmith105's avatar

I have only done this with Relationship Managers in Filament 3.x

Schema wise you may want to consider putting the user details in the user model. In my opinion, it makes more sense since most of the user details in the information is immutable and also will never be a OneToMany relation.

Please or to participate in this conversation.