Handle exceptions properly:
Custom Exception
class PaymentFailedException extends Exception
{
public function render($request)
{
return response()->json([
'error' => 'Payment failed'
], 422);
}
}Report Exception
public function report()
{
Log::error('Payment failed', ['user' => auth()->id()]);
}In Handler
public function register()
{
$this->reportable(function (PaymentFailedException $e) {
// Custom reporting
});
}Don't Report
protected $dontReport = [
ValidationException::class,
];