© 2026 Hedgehog Software, LLC

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

Repeater and pivot table

Hi, I'm facing an issue with Repeater and a BelongsToMany Relationship.

Here's my Project model :
class Project extends Model
{
  public function members(): BelongsToMany
  {
    return $this->belongsToMany(User::class);
  }
}
class Project extends Model
{
  public function members(): BelongsToMany
  {
    return $this->belongsToMany(User::class);
  }
}


My pivot table, called "project_user", has a "project_role" column.

Then I have in my EditProject (App\Filament\Resources\ProjectResource\Pages\EditProject) the following Repeater :
Repeater::make('members')->schema([ 
  
  Select::make('user_id')->label('Member email')->options(User::all()->pluck('email', 'id'))->searchable()->required(), 

  Select::make('project_role')->options(...)->required() 
])->createItemButtonLabel('Add member')
Repeater::make('members')->schema([ 
  
  Select::make('user_id')->label('Member email')->options(User::all()->pluck('email', 'id'))->searchable()->required(), 

  Select::make('project_role')->options(...)->required() 
])->createItemButtonLabel('Add member')


I'd like the "project_role" select to automatically fill this pivot column, however it does not work, it tries to fill my "users" table.

Any idea?
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

Repeater with pivot table
FilamentFFilament / ❓┊help
11mo ago
Repeater Pivot Table with Order
FilamentFFilament / ❓┊help
2y ago
Repeater pivot
FilamentFFilament / ❓┊help
3y ago
save repeater data in pivot table
FilamentFFilament / ❓┊help
2y ago