Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
37 | public static function notificationsData($userId): array |
||
38 | { |
||
39 | $user = User::find($userId); |
||
40 | |||
41 | return [ |
||
42 | 'notifications' => $user->notifications->take(8), |
||
43 | 'hasUnreadNotifications' => $user->unreadNotifications->isNotEmpty(), |
||
44 | 'unredNotificationsCount' => $user->unreadNotifications->count() |
||
45 | ]; |
||
46 | } |
||
47 | } |
||
48 |