Sydd
How to send parameter to CreateAction?
Few days ago, I do something like that.., on the relationmanager table have a table header action
Tables\Actions\CreateAction::make()
->label(__('general.create') . ' ' . lcfirst(__('general.record')))
->icon(MedicalExamResource::getNavigationIcon())
->url(MedicalExamResource::getUrl('create', ['employee' => $this->getOwnerRecord()->id])),
Next on the create page
protected function fillForm(): void
{
if(request()->employee) {
$employee = Employee::find(request()->employee);
$this->form->fill([
'customer_id' => $employee->customer_id,
'employee_id' => $employee->id,
'type' => $employee->medicalExams->isEmpty() ? 'entry' : 'periodic',
'job_factors' => JobFactorService::getEmployeeJobFactorsToFillMedicalExamFormSelect($employee),
'job_activities' => JobActivitiesService::getEmployeeJobActivitiesToFillMedicalExamFormSelect($employee),
]);
} else {
$defaultCustomerId = MedicalExamService::getCustomersWithAllowedMedicalExamsCountByRole() === 1
? MedicalExamService::getCustomersWithAllowedMedicalExamsIdsByRole()[0]
: null;
$this->form->fill([
'customer_id' => $defaultCustomerId,
'employee_id' => null,
'type' => null,
'job_factors' => [],
'job_activities' => [],
]);
}
}
9 replies
Custom Action successRedirectUrl
protected function getFormActions(): array
{
return [
Action::make('save')
->label(__('filament-panels::resources/pages/edit-record.form.actions.save.label'))
->submit('save')
->after(function ($record) {
redirect(SomeResource::getUrl('view', ['record' => $record]));
}),
];
}
12 replies
Spatie media libary and S3 -> disk cannot be accesed
Okay, so after installing Laravel Herd and running the application using Homestead, everything works as it should. Using the regular php artisan serve did not work. I apologize for the unnecessary troubles. @toeknee thanks.
13 replies
Spatie media libary and S3 -> disk cannot be accesed
So, when i try upload files from live server, it works, probably problem is that on the computer is sending / getting without SSL ..., please anybody know how to solve ? or how to create SSL for artisan:serve / localhost ? my PC operating system is win 11.
13 replies