F
Filament9mo ago
vkDas

Default data not showing in page

I have a custom resource page in which I have sent an email through this resource and a page will open when I click on the button present inside the mail and I want to show the corresponding data and the data is present inside the mount function but the data is not showing in the UI . All the data is present inside the $appraisal_response. Please help me to fix this issue...Thank you and here is the code class ResponseRequest extends EditRecord { protected static string $resource = ResponseResource::class; protected static string $layout = 'components.response-request.layouts.app'; public $employee_code_with_full_name; public $review_period_start_date; public $review_period_end_date; public $type; public $appraisal_session_id; public function mount(int | string $record = null): void { try { $data = JWT::decode(app('request')->input('token'), ['header' => true]); } catch (\Throwable $th) { abort(403); } $appraisal_response = Response::where([['id', $data['response_id']], ['status', ResponseStatus::DRAFT]])->first(); // dd($appraisal_response); if (!$appraisal_response) { abort(404); } parent::mount($appraisal_response->id); } protected function getHeaderActions(): array { return [ // ]; } protected function afterSave(): void { $this->record->status = ResponseStatus::SUBMITTED(); $this->record->save(); } public function form(Form $form): Form { $form = static::$resource::form($form, true); return $form; } }
2 Replies
Vp
Vp9mo ago
You need to fill the form like $this->form->fill($data) in mount
vkDas
vkDas9mo ago
Thank you for the response but in v2 this code is working fine but in v3 it is not working while I am triggering a email and I want to fill the form by default with the initial record values but it is not working. I tried this but when I try to set the default data using fill() it is not working and it is showing this error "Unable to find component: [app.filament.resources.appraisal-response-resource.pages.appraisal-response-request] and I can't configure out where the problem is occurring. Please help me to solve this issue. Thank you.
Want results from more Discord servers?
Add your server
More Posts
Troubleshooting Default Value Display in Custom Resource PageI have built a custom resource page, and inside it, I have a 'mount' function. However, the default Applying table filters with action instead of `wire:model.live` on eachHas anyone got a trait or something they use to prevent a table's filters from automatically being a[Spatie-Permissions] Possibilities of assigning roles to both teams and usersHello everyone! I have a simple question. Is it possible to use spatie-permissions for both users aIntegrating Filament Spatie Tags with Translatable - Code Share RequestSeeking advice on merging Filament Spatie Tags with its Translatable support. If anyone has successfPopulate repeaterI have a repeater which creates a DB entry on a related table. But I can't get the repeater to pull requiresConfirmation with ToggleColumnHello, I have a table with unlocked ToggleColumn and I want to be able to add a confirm popup when IResources/js/app.js and css/app.css not workingNot sure what I'm missing here, but any CSS or JS I add to these files are not having any effect. I'showing headerActions based on what tab you are onI'm trying to show a header action only if you are not on the 'all' tab. when i output $livewire->acUpdating a date with a Table Toggle.Hi, I have a dateTime filed called `archived_on`. I'd like to edit this column using a toggle field Accessing variables from within createOptionFormHope anyone can help me, the question boils down to: Is it possible to receive form values from with