How can I populate repeater's relation in an action from

Tables\Actions\Action::make('show_reports')
    ->record(fn ($record) => $record)
    ->form([
        Forms\Components\Repeater::make('reports')
            ->relationship('reports')
            ->disableItemCreation()
            ->disableItemDeletion()
            ->disableItemMovement()
            ->schema([
                Forms\Components\TextInput::make('violation_id')
                    ->disabled()
                    ->disableLabel(),
                Forms\Components\TextInput::make('admin_comment')
                    ->disabled()
                    ->disableLabel(),
            ])
    ])
    ->action(function () {
    }),


The repeater fields are empty
I tried adding ->record(fn ($record) => $record) but did not work

Forms\Components\Repeater::make('reports')
    ->relationship('reports')
    ->disableItemCreation()
    ->disableItemDeletion()
    ->disableItemMovement()
    ->schema([
        Forms\Components\TextInput::make('violation_id')
            ->disabled()
            ->disableLabel(),
        Forms\Components\TextInput::make('admin_comment')
            ->disabled()
            ->disableLabel(),
    ])


This code works fine when I place it in the edit page form builder
Was this page helpful?