mirror of
https://github.com/flarum/core.git
synced 2025-07-23 01:31:40 +02:00
Add API methods to add POST/DELETE routes to the API
This commit is contained in:
@@ -24,11 +24,21 @@ class RegisterApiRoutes
|
|||||||
$this->route('get', $url, $name, $action);
|
$this->route('get', $url, $name, $action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function post($url, $name, $action)
|
||||||
|
{
|
||||||
|
$this->route('post', $url, $name, $action);
|
||||||
|
}
|
||||||
|
|
||||||
public function patch($url, $name, $action)
|
public function patch($url, $name, $action)
|
||||||
{
|
{
|
||||||
$this->route('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)
|
protected function route($method, $url, $name, $action)
|
||||||
{
|
{
|
||||||
$this->routes->$method($url, $name, $this->action($action));
|
$this->routes->$method($url, $name, $this->action($action));
|
||||||
|
Reference in New Issue
Block a user