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 https://discord.com/channels/883083792112300104/1197452689135652894 <?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]; } }
2 Replies
Dan Harrin
Dan Harrin8mo ago
where is hello() called
gemini.dev
gemini.devOP8mo ago
I need it to be called inside a custom form field: <x-dynamic-component :component="$getFieldWrapperView()" :id="$getId()" :label="$getLabel()" :label-sr-only="$isLabelHidden()" :helper-text="$getHelperText()" :hint="$getHint()" :hint-action="$getHintAction()" :hint-color="$getHintColor()" :hint-icon="$getHintIcon()" :required="$isRequired()" :state-path="$getStatePath()" > <div x-data="{ state: $wire.entangle('{{ $getStatePath() }}').defer }"> <!-- Interact with the state property in Alpine.js --> </div> </x-dynamic-component> But not yet figured out how to call it.
Want results from more Discord servers?
Add your server