© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
Jap

Select multiple inside Repeater saved in one model.

Repeater::make('employeeDesignations')
    ->schema([
        Select::make('department_id')
            ->multiple()
            ->options(
            User::all()->pluck('name', 'id')
            )
            ->required(),
        Select::make('term_id')
            ->options(
            Term::all()->pluck('name', 'id')
            )
            ->required(),
    ])
    ->columns(2)
Repeater::make('employeeDesignations')
    ->schema([
        Select::make('department_id')
            ->multiple()
            ->options(
            User::all()->pluck('name', 'id')
            )
            ->required(),
        Select::make('term_id')
            ->options(
            Term::all()->pluck('name', 'id')
            )
            ->required(),
    ])
    ->columns(2)


Model:
class Employee extends Model
{
  public function employeeDesignations()
    {
        return $this->hasMany(EmployeeDesignation::class);
    }
}
class EmployeeDesignation extends Model
{

    protected $fillable = [
        'employee_id',
        'department_id',
        'term_id',
    ];
}
class Employee extends Model
{
  public function employeeDesignations()
    {
        return $this->hasMany(EmployeeDesignation::class);
    }
}
class EmployeeDesignation extends Model
{

    protected $fillable = [
        'employee_id',
        'department_id',
        'term_id',
    ];
}


Anyone can help me implement this? Thanks. Im getting error department_id should be string instead of array. I'm trying to lessen the rows created in the repeater by just using select multiple if it will just have the same term_id.
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

Select in repeater
FilamentFFilament / ❓┊help
2y ago
Repeater Inside Repeater
FilamentFFilament / ❓┊help
7mo ago
multiple select inside a table
FilamentFFilament / ❓┊help
12mo ago
How to access $record in RelationManager inside Repeater Select
FilamentFFilament / ❓┊help
3y ago