diff --git a/framework/core/src/Admin/Actions/IndexAction.php b/framework/core/src/Admin/Actions/IndexAction.php index 1398482d9..d576df37b 100644 --- a/framework/core/src/Admin/Actions/IndexAction.php +++ b/framework/core/src/Admin/Actions/IndexAction.php @@ -1,16 +1,26 @@ apiClient = $apiClient; + $this->actor = $actor; + } + protected function render(Request $request, $routeParams = []) { $config = DB::table('config')->whereIn('key', ['base_url', 'api_url', 'forum_title', 'welcome_title', 'welcome_message'])->lists('value', 'key'); @@ -24,13 +34,11 @@ class IndexAction extends HtmlAction 'token' => Cookie::get('flarum_remember') ]; - $response = app('Flarum\Api\Actions\Users\ShowAction') - ->handle(new ApiRequest(['id' => $user->id], $this->actor)) - ->content->toArray(); + $response = $this->apiClient->send('Flarum\Api\Actions\Users\ShowAction', ['id' => $user->id]); - $data = [$response['data']]; - if (isset($response['included'])) { - $data = array_merge($data, $response['included']); + $data = [$response->data]; + if (isset($response->included)) { + $data = array_merge($data, $response->included); } }