Файловый менеджер - Редактировать - /home/clickysoft/public_html/assets.clickysoft.net/app/Repositories/NotificationsRepository.php
Назад
<?php namespace App\Repositories; use App\Http\Resources\Api\UserNotificationsResource; class NotificationsRepository implements NotificationsRepositoryInterface { public function getAllNotifications() { $user = auth()->user(); return [ "notifications" => $user->notifications()->paginate(10), "unreadCount" => $user->unreadNotifications()->count() ]; } public function getNotification($notificationId) { $notification = auth()->user()->notifications()->find($notificationId); if ($notification) { $notification->markAsRead(); return new UserNotificationsResource($notification); } return response()->json(['message' => 'Notification not found'], 404); } public function markAllNotificationsAsRead() { $user = auth()->user(); $user->unreadNotifications->markAsRead(); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка