/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $promo = Promo::find($id); $promo->state = 1; $promo->save(); return redirect('/app/promos'); }
public function promoShowChef($id) { $filiere = Session::get('user')->filieres[0]; $promotions = $filiere->promos; $etudiants_count = Filiere::nbreEtudiantByFiliere($filiere->id); $enseignants_count = Enseignant::count(); $promos_count = count($promotions); $absences_count = 0; if ($promos_count > 0) { foreach ($promotions as $promotion) { $absences_count = $absences_count + Filiere::nbreAbsencesByPromo($promotion->id); } } $promo = Promo::find($id); $matieres = $promo->matieres; $modules = null; $j = 0; foreach ($matieres as $matiere) { $modules[$j] = $matiere->module; $j++; } return View('app/modules_absences', ['etudiants_count' => $etudiants_count, 'enseignants_count' => $enseignants_count, 'absences_count' => $absences_count, 'promos_count' => $promos_count, 'promotion' => $promo, 'modules' => $modules, 'filiere' => $filiere, 'statistics' => null]); }