message = $message; parent::__construct($message, $code, $previous); } /** * Report the exception. */ public function report(): void { Log::channel('notification_service') ->error(OperatorOfflineException::class, [__('messages.the_operator_is_offline')] ); } /** * Render the exception into an HTTP response. */ public function render(): JsonResponse { return response()->json([ 'message' => $this->message ], $this->code); } }