© 2026 Hedgehog Software, LLC

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

Repeater: Get current form id

I have this task table where fields are
id
id
,
title
title
,
description
description
,
creator_id
creator_id
,
due_date
due_date
,
parent_id
parent_id
,
type
type

I added Repeater on my $form , my goal is I want create sub task, which is determine by
type
type
and also under what main task
parent_id
parent_id
.

How to get the
id
id
and assign it as default on my
TextInput::make('parent_id')
TextInput::make('parent_id')


return $form
->schema([
    TextInput::make('title')
        ->required()
        ->autofocus(),
    Forms\Components\MultiSelect::make('user_id')                    
        ->label('Assigned to')
        ->relationship('assignees','user_id')
        ->multiple()
        ->options(User::pluck('name','id')->toArray()),
    DatePicker::make('due_date')
        ->label('Due Date')
        ->minDate(now()),
    TextInput::make('creator_name')
        ->label('Created by')
        ->default(auth()->user()->name)
        ->disabled()
        ->hint('Creator: '.auth()->user()->name)
        ->hintIcon('tabler-info-circle'),
    TextInput::make('creator_id')
        ->default(auth()->user()->id)
        ->hidden(),     
    Textarea::make('description')->required(), 
    Forms\Components\Repeater::make('subtask')
    ->schema([
        TextInput::make('title')->required(),
        Textarea::make('description')->required(),
        TextInput::make('parent_id')
        ->default() // this id of the task
        ->hidden(),  
    ])
    ->createItemButtonLabel('Add subtask')
    ->collapsed()
]);
return $form
->schema([
    TextInput::make('title')
        ->required()
        ->autofocus(),
    Forms\Components\MultiSelect::make('user_id')                    
        ->label('Assigned to')
        ->relationship('assignees','user_id')
        ->multiple()
        ->options(User::pluck('name','id')->toArray()),
    DatePicker::make('due_date')
        ->label('Due Date')
        ->minDate(now()),
    TextInput::make('creator_name')
        ->label('Created by')
        ->default(auth()->user()->name)
        ->disabled()
        ->hint('Creator: '.auth()->user()->name)
        ->hintIcon('tabler-info-circle'),
    TextInput::make('creator_id')
        ->default(auth()->user()->id)
        ->hidden(),     
    Textarea::make('description')->required(), 
    Forms\Components\Repeater::make('subtask')
    ->schema([
        TextInput::make('title')->required(),
        Textarea::make('description')->required(),
        TextInput::make('parent_id')
        ->default() // this id of the task
        ->hidden(),  
    ])
    ->createItemButtonLabel('Add subtask')
    ->collapsed()
]);
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 form get current resource id
FilamentFFilament / ❓┊help
3y ago
Get the parent id inside child repeater form
FilamentFFilament / ❓┊help
2y ago
Repeater form, getting current element index?
FilamentFFilament / ❓┊help
2y ago
Get current form values
FilamentFFilament / ❓┊help
3y ago