F
Filament3y ago
mcdc

Store data to pivot table

How do I call or store some data to my pivot_table task_user public static function form(Form $form): Form { return $form ->schema([ TextInput::make('title')->required(), TextInput::make('description')->required(), Forms\Components\MultiSelect::make('assignee_id') ->label('Assigned to') ->multiple() ->options(User::pluck('name', 'id')->toArray()), TextInput::make('creator_id') ->label('Creator') ->default(auth()->user()->id) ->disabled() ->hint('Creator '.auth()->user()->name) ->hintIcon('tabler-info-circle'), DatePicker::make('due_date') ->label('Due Date') ->minDate(now()) ]); } So I want those assignee_id to be store on my task_user table I did try this one out, and seems like I cant figure it out https://filamentphp.com/docs/2.x/admin/resources/relation-managers#creating-with-pivot-attributes
Filament
Relation managers - Resources - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.
3 Replies
adam
adam3y ago
Have you added withPivot to your model relations?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
mcdc
mcdcOP3y ago
Thansk for pointing out, ill try this one at home

Did you find this page helpful?