diff --git a/framework/core/src/Extend/ApiLink.php b/framework/core/src/Extend/ApiLink.php new file mode 100644 index 000000000..6450ad58e --- /dev/null +++ b/framework/core/src/Extend/ApiLink.php @@ -0,0 +1,28 @@ +actions = $actions; + $this->relationships = $relationships; + } + + public function extend(Application $app) + { + foreach ((array) $this->actions as $action) { + $parts = explode('.', $action); + $class = 'Flarum\Api\Actions\\'.ucfirst($parts[0]).'\\'.ucfirst($parts[1]).'Action'; + + foreach ((array) $this->relationships as $relationship) { + $class::$link[] = $relationship; + } + } + } +}