© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•11mo ago•
6 replies
delboy1978uk

Having trouble setting up a belongs to many select

i have 3 tables,
quality_control_steps
quality_control_steps
,
machine_centers
machine_centers
,and a join table
machine_center_quality_control_step
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
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()
            ]);
    }
 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', ...
 ->relationship('machineCenters', ...


filament does not know your set up, neither do I.. I'm going to make the assumption that
qualityControlSteps
qualityControlSteps
are related to
machineCenters
machineCenters
. in which case you would need to use
->relationship('machineCenters.qualityControlSteps', 'titleColumn')
->relationship('machineCenters.qualityControlSteps', 'titleColumn')
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Belongs to many showing error
FilamentFFilament / ❓┊help
2y ago
Belongs to Many multi-select values not coming in form data
FilamentFFilament / ❓┊help
3y ago
Select many to many problem
FilamentFFilament / ❓┊help
3y ago
morph to many select
FilamentFFilament / ❓┊help
15mo ago