From 11a20c5be971d97f4a4f575f91b706791c1893a9 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sun, 26 Apr 2015 23:29:17 +0200 Subject: Competitions; CompetitionTypes; Participants; better routing; administrators; ... --- src/controllers/CompetitionController.php | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/controllers/CompetitionController.php (limited to 'src/controllers/CompetitionController.php') diff --git a/src/controllers/CompetitionController.php b/src/controllers/CompetitionController.php new file mode 100644 index 0000000..6529433 --- /dev/null +++ b/src/controllers/CompetitionController.php @@ -0,0 +1,36 @@ +competition = $competition; + } + + public function index() { + return $this->competition->all(); + } + + public function show($id) { + return $this->competition->findOrFail($id); + } + + public function update($id) { + throw new \Exception("Not implemented yet."); + } + + public function store() { + $this->competition->fill(Input::all()); + + if ($this->competition->save()) { + return $this->response->created(); + } else { + throw new Dingo\Api\Exception\StoreResourceFailedException; + } + } + +} \ No newline at end of file -- cgit v1.2.3