public function anyAll() { $results = Encuesta::all(['id', 'titulo', 'tiempo_resolucion', 'termino', 'curso', 'user_id', 'cantidad_preguntas'])->each(function (Encuesta $encuesta) { $encuesta->creador_por = $encuesta->user->fullname; $encuesta->preguntas = $encuesta->preguntas()->count() . '/' . $encuesta->cantidad_preguntas; }); return ['data' => $results]; }