© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
2 replies
Luuk Dahlmans

How do I create a relation manager for a pivot table

Hello,

I have a Container class and I have a Transporter class. i have a pivot table with transporter_id, container_id and price called container_transporter.

I would like to manage the containers and price in the transporter resource.

I have setup my models like this:
// In Container model
public function transporters()
{
    return $this->belongsToMany(Transporter::class, 'container_transporter')
                ->withPivot('price');
}
// In Container model
public function transporters()
{
    return $this->belongsToMany(Transporter::class, 'container_transporter')
                ->withPivot('price');
}


// In Transporter model
public function containers()
{
    return $this->belongsToMany(Container::class, 'container_transporter')
                ->withPivot('price');
}
// In Transporter model
public function containers()
{
    return $this->belongsToMany(Container::class, 'container_transporter')
                ->withPivot('price');
}


How do I set this up in the relationmanager?
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

Relation Manager for pivot table
FilamentFFilament / ❓┊help
2y ago
Create a relationship manager for a pivot table
FilamentFFilament / ❓┊help
3y ago
Reordable pivot table in Relation Manager
FilamentFFilament / ❓┊help
3y ago
How to properly use table relation, pivot table, and relation manager
FilamentFFilament / ❓┊help
15mo ago