コード例 #1
0
 public function marcarComoNoLeido($id)
 {
     $notificacion = Notificacion::find($id);
     $notificacion->leido = 0;
     $notificacion->save();
     return Response::json($notificacion, 200);
 }
コード例 #2
0
 public function toggleNotificacion($id)
 {
     $notificacion = Notificacion::find($id);
     if ($notificacion->user_id != Auth::user()->id) {
         Response::make('No Permitido', 403);
     }
     $notificacion->leido = $notificacion->leido == 0 ? 1 : 0;
     $notificacion->save();
     if (Request::ajax()) {
         return Response::json($notificacion, 200);
     } else {
         flashMessage('Listo');
         return Redirect::back();
     }
 }
コード例 #3
0
 public function eliminarnotificacion($id)
 {
     if (Notificacion::find($id)->user_id == Auth::user()->id) {
         Notificacion::destroy($id);
         flashMessage("Notificacion Eliminada");
         return Redirect::back();
     } else {
         return "No posee los permisos para hacer esta operacion";
     }
 }