Example #1
0
 public function maps($tournament)
 {
     $maps = new Collection();
     $this->reports($tournament)->get()->each(function ($report) use(&$maps) {
         $maps->push(Map::find($report->map));
     });
     return $maps;
 }
Example #2
0
    if ($tournament == null) {
        App::abort(404);
    } else {
        return $tournament;
    }
});
Route::bind('round', function ($key, $route) {
    $round = Round::find($key);
    if ($round == null) {
        App::abort(404);
    } else {
        return $round;
    }
});
Route::bind('map', function ($key, $route) {
    $round = Map::find($key);
    if ($round == null) {
        App::abort(404);
    } else {
        return $round;
    }
});
Route::bind('scenario', function ($key, $route) {
    $round = Scenario::find($key);
    if ($round == null) {
        App::abort(404);
    } else {
        return $round;
    }
});
Route::bind('report', function ($key, $route) {
 /**
  * Remove the specified user from storage.
  *
  * @param $map
  * @internal param $id
  * @return Response
  */
 public function deleteIndex($map)
 {
     $id = $map->id;
     if (!$map->delete()) {
         return Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
     }
     $maps = Map::find($id);
     return empty($maps) ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
 }