Files
animethemes-server/app/Exceptions/Handler.php
T
2025-10-01 17:18:31 -03:00

37 lines
862 B
PHP

<?php
declare(strict_types=1);
namespace App\Exceptions;
use App\Models\Admin\ActionLog;
use Filament\Facades\Filament;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
class Handler extends ExceptionHandler
{
/**
* A list of the inputs that are never flashed to the session on validation exceptions.
*
* @var array<int, string>
*/
protected $dontFlash = [
'current_password',
'password',
'password_confirmation',
];
/**
* Register the exception handling callbacks for the application.
*/
public function register(): void
{
$this->reportable(function (Throwable $e): void {
if (Filament::isServing() && $this->shouldReport($e)) {
ActionLog::updateCurrentActionLogToFailed($e);
}
});
}
}