public function indexByClass($class)
 {
     $classe = Classe::findOrFail($class);
     $enfants = $classe->enfants()->paginate(20);
     $path = 'enfants/' . $class;
     $enfants->setPath($path);
     return view('enfants.listeEnfants', compact('enfants'));
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $classe = Classe::findOrFail($id);
     $classe->delete();
     return redirect(route('niveau.index'));
 }
Esempio n. 3
0
 public function removeFromClassAdmin($classe_id, $user_id)
 {
     $user = User::findOrFail($user_id);
     $class = Classe::findOrFail($classe_id);
     $this->doRemoveFromClass($class, $user);
     $tags = ["first_name" => $user->first_name, "last_name" => $user->last_name, "class_title" => $class->title, "class_date" => $class->date, "class_end_date" => $class->end_date, "location" => $class->location->name];
     EmailHelper::sendEmail(EmailHelper::REMOVE_ATTENDEE, $tags, $user->email);
     return Redirect::back()->with("good", "Successfully removed from class.");
 }