refactor ClientWidgetFormController; replace validation logic with SubmitWidgetFormAction for improved maintainability and clarity
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Containers\Widget\Tasks;
|
||||
|
||||
use App\Containers\Widget\Models\CustomFormResponse;
|
||||
|
||||
class StoreWidgetFormResponseTask
|
||||
{
|
||||
public function run(int $formId, array $validatedData): void
|
||||
{
|
||||
CustomFormResponse::create([
|
||||
'custom_form_id' => $formId,
|
||||
'answers' => $validatedData,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user