Beispiel #1
0
 public function swc()
 {
     $season = SwcSeason::active()->first();
     $comp = $season->competitions()->active()->first();
     $skills = new Skills();
     $skill = $skills->getById($comp->skill)->get('name');
     $tracker = array();
     $i = 0;
     $comp->members->each(function ($member) use($comp, $skill, &$tracker, &$i) {
         $tracker[$i]['name'] = $member->display_name;
         $tracker[$i]['start'] = $member->stats()->start($comp->start_at, $skill . '_xp');
         $tracker[$i]['end'] = $member->stats()->end($comp->end_at, $skill . '_xp');
         $tracker[$i]['gain'] = $member->stats()->end($comp->end_at, $skill . '_xp') - $member->stats()->start($comp->start_at, $skill . '_xp');
         $i++;
     });
     $d['skill'] = ucfirst($skill);
     $d['tracker'] = $tracker;
     return view('site.swc', $d);
 }
Beispiel #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  \Clan\Models\SwcSeason  $season
  * @param  \Clan\Http\Requests\Admin\Swc\Season\Destroy  $request
  * @return Response
  */
 public function destroy(SwcSeason $season, Requests\Admin\Swc\Season\Destroy $request)
 {
     if ((bool) $request->input('confirmation') !== true) {
         return redirect()->back()->withInput()->withErrors(new MessageBag(['Please confirm you wish to delete this season and all associated data']));
     }
     $season->delete();
     return redirect(route('admin.swc.season.index'))->with('successes', new MessageBag(['Season successfully deleted']));
 }
Beispiel #3
0
 public function index()
 {
     $d['seasons'] = SwcSeason::active()->get();
     $d['archived'] = SwcSeason::archived()->get();
     return view('admin.swc.index', $d);
 }