add load more pagination of notificaiton

This commit is contained in:
weiweitoo
2018-07-26 22:58:22 +08:00
parent 8d450fb65e
commit 91c37778dc
6 changed files with 79 additions and 36 deletions
+2 -1
View File
@@ -359,8 +359,9 @@ class BookingController extends Controller
// $booking->usd_book_cnap = $request->input('usd_book_cnap');
// $booking->usd_book_bank_branch = $request->input('usd_book_bank_branch');
// $booking->verification_status = $request->input('verification_status');
// return response()->json($booking, 201);
$booking->save();
//return response()->json('error', 400);
// return response()->json('error', 400);
return response()->json($booking, 201);
}
@@ -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);
}