public function markRead(Notification $notification)
 {
     if (!$notification->is_read) {
         $notification->is_read = 1;
         $notification->save();
     }
     return response()->json('Notification marked read', 200);
 }
 public function getActivityLogs()
 {
     $logs = Notification::with('sent_to_user', 'sent_by_user')->orderBy('created_at', 'desc')->paginate(15);
     return response()->json($logs, 200);
 }
Example #3
0
 public function clear(Request $request)
 {
     $notifications = Notification::with('id')->delete();
     return redirect()->back();
 }