1 回答

TA貢獻(xiàn)1757條經(jīng)驗(yàn) 獲得超7個(gè)贊
這是我覆蓋 addFlash 方法的解決方案:
protected function addFlash(string $type, string $message): void
{
// Generate the required arguments on userAlerts service
try {
$datetimeUTC = new DateTime('now', new DateTimeZone('UTC'));
$alertId = Uuid::uuid4();
$this->userAlertsService->addAlert($datetimeUTC, $type, $message, $this->getUser(), $alertId);
} catch (Throwable $throwable) {
$this->logger->critical("Add Flash: Ko. Details: {$throwable->getMessage()}");
}
parent::addFlash($type, $message);
}
- 1 回答
- 0 關(guān)注
- 88 瀏覽
添加回答
舉報(bào)