Пример #1
0
 /**
  * Show the form for creating a new voting.
  *
  * @return Response
  */
 public function create()
 {
     $types = VoteType::lists('title', 'id');
     // Get all vote types for the form
     $objectives = VoteObjective::lists('title', 'id');
     // Get all vote objectives for the form
     return view('votings.create', compact('types', 'objectives'));
 }
 /**
  * Remove the specified vote objective from storage.
  *
  * @param  int  $id The id of the objective to delete
  * @return Response
  */
 public function destroy($id)
 {
     // Find and delete objective
     $vo = VoteObjective::findOrFail($id);
     $vo->delete();
     // Redirect
     Session::flash('message', 'Το αντικείμενο ψηφοφορίας διαγράφηκε με επιτυχία!');
     return Redirect::to('voteobjectives');
 }