close #655 Added: App Store add app documentation
This commit is contained in:
@ -325,4 +325,19 @@ class Item extends Controller
|
||||
'html' => $html,
|
||||
]);
|
||||
}
|
||||
|
||||
public function documentation($alias)
|
||||
{
|
||||
$this->checkApiToken();
|
||||
|
||||
$documentation = $this->getDocumentation($alias);
|
||||
|
||||
if (empty($documentation)) {
|
||||
return redirect('apps/' . $alias)->send();
|
||||
}
|
||||
|
||||
$back = 'apps/' . $alias;
|
||||
|
||||
return view('modules.item.documentation', compact('documentation', 'back'));
|
||||
}
|
||||
}
|
||||
|
@ -57,6 +57,17 @@ trait Modules
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getDocumentation($alias)
|
||||
{
|
||||
$response = $this->getRemote('apps/docs/' . $alias);
|
||||
|
||||
if ($response && ($response->getStatusCode() == 200)) {
|
||||
return json_decode($response->getBody())->data;
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getModuleReviews($alias, $data = [])
|
||||
{
|
||||
$response = $this->getRemote('apps/' . $alias . '/reviews', 'GET', $data);
|
||||
|
Reference in New Issue
Block a user