akvaskov's avatar

akvaskov started a new conversation+100 XP

5mos ago

Hi,

I have a table and one toolbar action

            ->toolbarActions([
                Action::make('settings')
                    ->form([
                        Fieldset::make('chahgeLogPeriodSettings')
                            ->label('Use stock change logs')
                            ->schema([
                                DatePicker::make('chahgeLogFromSetting')
                                    ->label('From')
                                    ->default(Carbon::today()->subDays(7)),
                                DatePicker::make('chahgeLogTillSetting')
                                    ->label('Till')
                                    ->default(Carbon::today()),
                            ])
                    ]),

I'm trying to get values from the form of the action:

protected function getTableQuery(): Builder
    {
        $actions = $this->getTable()->getToolbarActions();
        dump($action[0]);
    }

If I add dump($actions[0]), I see that it will be Action object and there is a schema inside it. But how to get a respective array of this schema? I tried $actions[0]->getSchema(), ->getSchemaComponents(), getSchemaContainer() but all useless. Everything returns null or a message that the method doesn't exists. Please help!