mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 09:11:40 +08:00
Add API methods to add POST/DELETE routes to the API
This commit is contained in:
parent
e13bc1ac62
commit
025d8f691d
@ -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…
x
Reference in New Issue
Block a user