FilamentF
Filament2y ago
Noxo

The huge form is too slow

I have a form that has 200+ fields.
When saving I get the timeout error Maximum execution time of 30 seconds exceeded

Any ideas on how to speed this up?

The form is generated automatically (not static).

Tabs::make()
    ->hiddenOn('create')
    ->tabs(function ($record) {
        ray('tabs');

        $processors = once(fn () => $record->processors()->with('template')->get());

        return $processors
            ->map(
                fn ($processor) => Tab::make($processor->name)
                    ->statePath('fields.' . $processor->template_id)
                    ->schema(
                        $processor->template->fields
                            ->map(fn ($field) => FieldBuilderService::build(FieldData::from($field)))
                            ->toArray()
                    )
                    ->columns(2)
            )
            ->toArray();
    }),
Screenshot_2024-08-06_at_21.23.17.png
Was this page helpful?