Пример #1
0
 public static function delete($id)
 {
     $nt = Notifikasi::find($id);
     if (!is_null($nt->first())) {
         return $nt->delete();
     } else {
         return false;
     }
 }
Пример #2
0
 public function markAllAsRead()
 {
     $user = Auth::user();
     $notif = Notifikasi::where('action_to', '=', $user->id)->get();
     foreach ($notif as $nt) {
         $nt->status = 'read';
         $nt->update();
     }
 }
 public function delete($id)
 {
     $nt = Notifikasi::find($id);
     $nt->delete();
 }
Пример #4
0
 public static function getAllNotifForMe($user_id)
 {
     $notif = Notifikasi::where('action_to', '=', $user_id)->orderBy('created_at', 'desc')->get();
     return $notif;
 }