FilamentF
Filament3y ago
dyo

Passing data modalContent through component

I'm working with custom action to open a custom modal view, like these
    protected function getTableHeaderActions(): array
    {
        return [
            Action::make('format sebaran')->button()
                ->action(fn () => $this->record->advance())
                ->modalContent(
                    fn () => view(
                        'filament.pages.format-sebaran',
                        ['list' => FormatSebaranResource::collection($this->sebaran->take(10000))]
                    )
                )->modalActions([
                    ModalActionsAction::make('tutup')->cancel()
                        ->color('secondary')
                ]),
        ];
    }

The problem is, I want to send only $this->sebaran->take(1000), and create a new collection in component mount() or render(), so I can user wire:init when the data is ready to use..

What should I do?
Was this page helpful?