From 262cfb84f0febbc60fea6121161e338770114c52 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sun, 2 Aug 2015 17:26:30 +0930 Subject: [PATCH] Add API methods to add POST/DELETE routes to the API --- framework/core/src/Events/RegisterApiRoutes.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/framework/core/src/Events/RegisterApiRoutes.php b/framework/core/src/Events/RegisterApiRoutes.php index 943a9437a..206ce43c4 100644 --- a/framework/core/src/Events/RegisterApiRoutes.php +++ b/framework/core/src/Events/RegisterApiRoutes.php @@ -24,11 +24,21 @@ class RegisterApiRoutes $this->route('get', $url, $name, $action); } + public function post($url, $name, $action) + { + $this->route('post', $url, $name, $action); + } + public function patch($url, $name, $action) { $this->route('patch', $url, $name, $action); } + public function delete($url, $name, $action) + { + $this->route('delete', $url, $name, $action); + } + protected function route($method, $url, $name, $action) { $this->routes->$method($url, $name, $this->action($action));