diff options
author | Camil Staps | 2015-04-26 23:29:17 +0200 |
---|---|---|
committer | Camil Staps | 2015-04-26 23:29:17 +0200 |
commit | 11a20c5be971d97f4a4f575f91b706791c1893a9 (patch) | |
tree | 9748c5d865005531c074369ee1611ed8e0fa334a /src/controllers/ParticipantController.php | |
parent | user routes (diff) |
Competitions; CompetitionTypes; Participants; better routing; administrators; ...
Diffstat (limited to 'src/controllers/ParticipantController.php')
-rw-r--r-- | src/controllers/ParticipantController.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/controllers/ParticipantController.php b/src/controllers/ParticipantController.php new file mode 100644 index 0000000..2ca28fb --- /dev/null +++ b/src/controllers/ParticipantController.php @@ -0,0 +1,36 @@ +<?php +namespace CamilStaps\BotleaguesApi; + +use Illuminate\Support\Facades\Input; + +class ParticipantController extends BaseController { + + protected $participant; + + public function __construct(Participant $participant) { + $this->participant = $participant; + } + + public function index() { + return $this->participant->all(); + } + + public function show($id) { + return $this->participant->findOrFail($id); + } + + public function update($id) { + throw new \Exception("Not implemented yet."); + } + + public function store() { + $this->participant->fill(Input::all()); + + if ($this->participant->save()) { + return $this->response->created(); + } else { + throw new Dingo\Api\Exception\StoreResourceFailedException; + } + } + +}
\ No newline at end of file |