public function show($id) { try { $iteration = Iterations::findOrFail($id); $iterations = Iterations::where('projectid', '=', $iteration->projectid)->get(); $project = Project::findOrFail($iteration->projectid); $issues = Issue::where('iterationid', '=', $id)->get(); //$issues = $iteration->issues; $countIssues = sizeof($issues); $categories = Category::all(); $idCategory = 0; $totalPoints = $issues->sum('points'); $materiales = Material::all(); $personal = PersonalType::all(); $team = Teams::where('projectid', '=', $project->id)->get()->first(); $members = DB::table('memberof')->where('teamid', '=', $team->id)->get(); $hasmembers = sizeof($members) > 0 ? true : false; $users = array(); foreach ($members as $member) { $users[] = User::findOrFail($member->usersid); echo $hasmembers; } $this->layout->content = View::make('layouts.iterations.show')->with('iteration', $iteration)->with('iterations', $iterations)->with('issues', $issues)->with('categories', $categories)->with('idCategory', $idCategory)->with('countIssues', $countIssues)->with('totalPoints', $totalPoints)->with('project', $project)->with('materiales', $materiales)->with('personal', $personal)->with('hasmembers', $hasmembers)->with('members', $members)->with('users', $users)->with('message', ''); } catch (Illuminate\Database\Eloquent\ModelNotFoundException $e) { return Redirect::to('/projects/')->with('message', 'Error al crear la iteración'); } }