add time_interval feature in notification

This commit is contained in:
weiweitoo
2018-07-26 10:58:56 +08:00
parent d9a818c05a
commit 74b84acf36
3 changed files with 86 additions and 4 deletions
@@ -42,8 +42,11 @@ class NotificationController extends Controller
public function getUserMessage()
{
$user_all_notification = Notification::Where("user_id",Auth::user()->id)->orderby('updated_at','desc')->get();
return response()->json([
"message" =>Notification::Where("user_id",Auth::user()->id)->orderby('updated_at','desc')->get(),
"message" =>$user_all_notification,
"unread_message" =>Notification::Where([
["user_id",Auth::user()->id],
["is_read",0]
@@ -57,4 +60,6 @@ class NotificationController extends Controller
->update(array('is_read' => 1));
return response()->json("Read message", 200);
}
}