mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 06:03:39 +08:00
Add API methods to add POST/DELETE routes to the API
This commit is contained in:
parent
52125ce84c
commit
262cfb84f0
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue
Block a user