Пример #1
0
 public function getStart()
 {
     // Needs logged in user with voting privileges
     if (!(Auth::check() && Auth::user()->canStartVoting())) {
         return Redirect::to('/');
     }
     $current = Voting::current()->get();
     if (count($current) == 0) {
         if (Song::requests()->count() > 0) {
             $voting = new Voting();
             $voting->created_by = Auth::user()->id;
             $voting->save();
         } else {
             Session::flash('error', 'Geen nummers om over te stemmen! D:');
         }
     }
     return Redirect::to('/vote');
 }