public static function delete($id) { $nt = Notifikasi::find($id); if (!is_null($nt->first())) { return $nt->delete(); } else { return false; } }
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(); }
public static function getAllNotifForMe($user_id) { $notif = Notifikasi::where('action_to', '=', $user_id)->orderBy('created_at', 'desc')->get(); return $notif; }