mirror of
https://gitlab.com/omair-personal/exchange.git
synced 2026-08-19 12:34:13 +00:00
add load more pagination of notificaiton
This commit is contained in:
@@ -42,15 +42,16 @@ class NotificationController extends Controller
|
||||
|
||||
public function getUserMessage()
|
||||
{
|
||||
$user_all_notification = Notification::Where("user_id",Auth::user()->id)->orderby('updated_at','desc')->get();
|
||||
|
||||
$user_all_notification = Notification::Where("user_id",Auth::user()->id)
|
||||
->orderby('updated_at','desc')
|
||||
->paginate(5);
|
||||
$user_unread_notification = Notification::Where([["user_id",Auth::user()->id],["is_read",0]])
|
||||
->orderby('updated_at','desc')
|
||||
->get();
|
||||
|
||||
return response()->json([
|
||||
"message" =>$user_all_notification,
|
||||
"unread_message" =>Notification::Where([
|
||||
["user_id",Auth::user()->id],
|
||||
["is_read",0]
|
||||
])->orderby('updated_at','desc')->get()
|
||||
"unread_message" =>$user_unread_notification
|
||||
],200);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user