Error on the hidden method on Action (Typed property ...Component::$container)

Hello,
I am having some issues with an action that i have places inside a form:
Section::make(__('app..description'))
  ->schema([

      TableRepeater::make('name')
          ->label('label')
          ->relationship('relationship')
          ->schema([

              TextInput::make('product'),
              TextInput::make('company_id'),
              TextInput::make('quantity'),
              TextInput::make('price'),
              
              Actions::make([
                  Actions\Action::make('action_name')
                      ->label(__('app.label'))
                      ->requiresConfirmation()
                      ->color('danger')
                      ->tooltip(__('app._tooltip'))
                      ->iconButton()
                      ->icon('heroicon-o-x-circle')
                      ->action(function (ClusterOrderItemAssignment $item) {
                        //...
                      })
                      ->hidden(function (?Model $record) {
                          return $record->some_bool_attribute;
                      }),
              ]),
          ])
          ->hideLabels()
          ->columnSpanFull(),
  ]);


From my tests, when i add the hidden method and add a Model property to the callback i get this error:
Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization

Any idea why? it works on other fields, only on action I get this error.

As for versions:
  • PHP 8.2.11
  • Laravel: 10.41.0
  • Filament: 3.0.12
Was this page helpful?