action not working
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);
});
}
public function addGame(Session $session, array $data): Model
{
dd(123);
$data['start_time'] = Carbon::now()->toDateTimeString();
$this->endOngoingGame($session, GameTable::find($data['game_table_id']));
return $session->sessionGames()->create($data);
}
not coming in function . if it comes it should show dump 123
5 Replies
try (new SessionService)->addGame($this->session, $data);
->action((new SessionService))->addGame($this->session,$data);
like this ?
@Wbzy
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
like this
didnt work @Wbzy
this is a custom page
@Wbzy
ok i found the erroe
function name is end game and Action is ENd ..Name should be same . It works now
Thanks for your assistance too @Wbzy
good to hear