This commit is contained in:
Ubuntu 2023-12-13 22:02:40 +00:00
commit 0ec70c9ae6
2 changed files with 6 additions and 4 deletions

View File

@ -62,6 +62,6 @@ class NotificationController extends Controller
{ {
$response = $this->notification->getNotify(); $response = $this->notification->getNotify();
return ResponseJson::data($response); return response()->json($response);
} }
} }

View File

@ -17,7 +17,9 @@ class NotificationRepository extends AbstractRepository implements NotificationC
public function getNotify(): int public function getNotify(): int
{ {
return Notifications::query()->with('users') return Notifications::query()
->whereRelation('users', 'id', '=', auth()->id())->count(); ->with('users')
->whereRelation('users', 'id', '=', auth()->id())
->count();
} }
} }