© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
22 replies
Askancy

Create select with pivot relationship

I need to insert a Select with single selta in my project.

The main model of the project is "Game", The select takes data from the Franchise_pivot table in which it has:


-franchise_id
-gioco_id

And where it parses franchise_id (to return the name) in Franchise which is structured:

-id
-name

How can I implement this select?

Currently I have done:

                                     Select::make('Franchise')
                                        ->label('Franchise:')
                                        ->relationship('franchise')
                                        ->searchable(), 
                                     Select::make('Franchise')
                                        ->label('Franchise:')
                                        ->relationship('franchise')
                                        ->searchable(), 


Model "Game"
    public function franchise(): belongsTo
    {
        return $this->belongsTo(Franchise_pivot::class, 'id', 'gioco_id');
    }
    public function franchise(): belongsTo
    {
        return $this->belongsTo(Franchise_pivot::class, 'id', 'gioco_id');
    }


But the result is that I have the game id in the select, and not the franchise name
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Pivot Select using Relationship
FilamentFFilament / ❓┊help
2w ago
Relationship with pivot
FilamentFFilament / ❓┊help
3y ago
Form builder - trying to create/edit relationship with pivot
FilamentFFilament / ❓┊help
12mo ago
select field relationship create modal
FilamentFFilament / ❓┊help
3y ago