Having trouble setting up a belongs to many select

i have 3 tables, quality_control_steps, machine_centers,and a join table machine_center_quality_control_step

and i can see a row in my table, but i cant seem to get the select working, it should allow me to select from all rows from the quality_control_steps table:

 protected static string $relationship = 'qualityControlSteps';

    public function form(Form $form): Form
    {
        return $form
            ->schema([
                Select::make('quality_control_step_id')
                    ->multiple()
                    ->preload()
                    ->relationship('machineCenters', titleAttribute: 'name')
                    ->required()
            ]);
    }

but it shows me a list of the machine centers instead!
image.png
Solution
but it shows me a list of the machine centers instead!
because you asked for that ->relationship('machineCenters', ...

filament does not know your set up, neither do I.. I'm going to make the assumption that qualityControlStepsare related to machineCenters. in which case you would need to use
->relationship('machineCenters.qualityControlSteps', 'titleColumn')
Was this page helpful?