for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Thinktomorrow\Chief\System\HealthMonitor\Notifiers;
use Thinktomorrow\Chief\System\HealthMonitor\Checks\HealthCheck;
class ToastNotifier implements Notifier
{
public function onFailure(HealthCheck $healthCheck)
session()->now($this->generateUniqueSessionKey(), ['type' => 'warning', 'message' => $healthCheck->message() ]);
}
public function onSuccess(HealthCheck $healthCheck)
private function generateUniqueSessionKey(): string
$toastId = 'toast_messages.' . mt_rand(0, 9999);
while (session()->get($toastId)) {
return $toastId;