From 00c0181dce64a005324d2464f17ceaedabee10e5 Mon Sep 17 00:00:00 2001 From: marcio1002 Date: Wed, 13 Dec 2023 19:01:27 -0300 Subject: [PATCH] =?UTF-8?q?Corre=C3=A7=C3=A3o=20no=20endpoint=20notify?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/NotificationController.php | 2 +- app/Repositories/Notifications/NotificationRepository.php | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/NotificationController.php b/app/Http/Controllers/NotificationController.php index 8269d4d..3747bee 100644 --- a/app/Http/Controllers/NotificationController.php +++ b/app/Http/Controllers/NotificationController.php @@ -62,6 +62,6 @@ class NotificationController extends Controller { $response = $this->notification->getNotify(); - return ResponseJson::data($response); + return response()->json($response); } } diff --git a/app/Repositories/Notifications/NotificationRepository.php b/app/Repositories/Notifications/NotificationRepository.php index baa42db..68ddaeb 100644 --- a/app/Repositories/Notifications/NotificationRepository.php +++ b/app/Repositories/Notifications/NotificationRepository.php @@ -17,7 +17,9 @@ class NotificationRepository extends AbstractRepository implements NotificationC public function getNotify(): int { - return Notifications::query()->with('users') - ->whereRelation('users', 'id', '=', auth()->id())->count(); + return Notifications::query() + ->with('users') + ->whereRelation('users', 'id', '=', auth()->id()) + ->count(); } -} \ No newline at end of file +}