create notification for each step done. Make unread message bold.

This commit is contained in:
weiweitoo
2018-07-25 10:05:18 +08:00
parent ad5a9970ea
commit 336e5e4ed3
8 changed files with 87 additions and 32 deletions
@@ -11,7 +11,7 @@ class NotificationController extends Controller
{
public function index()
{
return Notification::all();
return Notification::all()->orderby('updated_at','desc');
}
public function show(Notification $notification)
@@ -43,11 +43,11 @@ class NotificationController extends Controller
public function getUserMessage()
{
return response()->json([
"message" =>Notification::Where("user_id",Auth::user()->id)->get(),
"message" =>Notification::Where("user_id",Auth::user()->id)->orderby('updated_at','desc')->get(),
"unread_message" =>Notification::Where([
["user_id",Auth::user()->id],
["is_read",0]
])->get()
])->orderby('updated_at','desc')->get()
],200);
}