Get data at ManageRecords

Before I create the record. I need to get the current state (current values) of the fields. How can I achieve so in my hello function? Similar to this post ❓┊helpHow to get form value?

<?php namespace App\Filament\Resources\DataResource\Pages; use App\Filament\Resources\DataResource; use App\Helpers\Helpers; use Filament\Pages\Actions\CreateAction; use Filament\Resources\Pages\ManageRecords; use Illuminate\Database\Eloquent\Collection; use Filament\Forms\Components\Actions\Action; class ManageData extends ManageRecords { protected static string $resource = DataResource::class; protected function getActions(): array { $records = new Collection(); return [ CreateAction::make() ->disableCreateAnother() ->using(function (array $data) use (&$records) { foreach ($data['filename'] as $filename) { $records[] = static::getModel()::create(['filename' => $filename]); } }) ->after(function (array $data) use ($records): ?\Symfony\Component\HttpFoundation\StreamedResponse { if (isset ($data['generate_pdf_files']) && $data['generate_pdf_files'] === true) { $response = Helpers::generatePDF($data, $records); return $response; } return null; }) ]; } public function hello() { // get data here dd(); } protected function getTableRecordsPerPageSelectOptions(): array { return [50, 100]; } }
Was this page helpful?