FormatUsingState is null on a select relationship

                Forms\Components\Select::make('sponsor_id')
                    ->relationship('sponsor', 'first_name')
                    ->native(false)
                    ->formatStateUsing(function ($state, $record) {
                        //console.log($record);
                        dd($state);
                        return $record->first_name . ' ' . $record->second_name;
                    })
                    ->label("Sponsor Name")
                    ->searchable()
                    ->preload(),
Was this page helpful?