ashar
action not working
i have modified it like this
public function endGame()
{
return Action::make('End')
->icon('heroicon-m-no-symbol')
->color('danger')
->action(function (array $data, SessionService $sessionService): void {
$sessionService->addGame($this->session, $data);
});
}
still action not performing
13 replies
hi,
dd($data) showing
array:3 [▼ // app/Filament/Resources/ExpenseResource/Pages/CreateExpense.php:27
"name" => "Laurel Conner"
"description" => "Veritatis velit lau"
"voucherDetails" => array:1 [▶]
]
you see i have array vcoucherDetilas in it but when i update record in mutate function
foreach ($data['voucherDetails'] as &$voucherDetail) {
$voucherDetail = array_merge($voucherDetail, [
'account_id' => $account,
'voucherable_type' => Account::class,
'created_by' => Auth::id(),
'voucherable_id' => $account,
'quantity' => 1,
]);
}
its not updating the data in voucherDetail. so for now i was setting default values based on account_id for name . The rest i have set to default
@Dennis Koch
15 replies
hi,
i am doing this already
protected function mutateFormDataBeforeCreate(array $data): array
{
$data = $this->data;
$data has my data and within it there is a array . when im updating , it doesnt fetches the array from $data and im unable to update those fields . SO for now i am updating it on default in the form . @Dennis Koch
15 replies