Apps hoe page add top paid, new, top free
This commit is contained in:
parent
8de2439002
commit
098ed4b26a
@ -19,9 +19,15 @@ class Home extends Controller
|
|||||||
{
|
{
|
||||||
$this->checkApiToken();
|
$this->checkApiToken();
|
||||||
|
|
||||||
$paid = $this->getPaidModules();
|
$data = [
|
||||||
$new = $this->getNewModules();
|
'query' => [
|
||||||
$free = $this->getFreeModules();
|
'limit' => 4
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
$paid = $this->getPaidModules($data);
|
||||||
|
$new = $this->getNewModules($data);
|
||||||
|
$free = $this->getFreeModules($data);
|
||||||
|
|
||||||
return view('modules.home.index', compact('paid', 'new', 'free'));
|
return view('modules.home.index', compact('paid', 'new', 'free'));
|
||||||
}
|
}
|
||||||
|
@ -56,9 +56,9 @@ trait Modules
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPaidModules()
|
public function getPaidModules($data = [])
|
||||||
{
|
{
|
||||||
$response = $this->getRemote('apps/paid');
|
$response = $this->getRemote('apps/paid', 'GET', $data);
|
||||||
|
|
||||||
if ($response->getStatusCode() == 200) {
|
if ($response->getStatusCode() == 200) {
|
||||||
return json_decode($response->getBody())->data;
|
return json_decode($response->getBody())->data;
|
||||||
@ -67,9 +67,9 @@ trait Modules
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNewModules()
|
public function getNewModules($data = [])
|
||||||
{
|
{
|
||||||
$response = $this->getRemote('apps/new');
|
$response = $this->getRemote('apps/new', 'GET', $data);
|
||||||
|
|
||||||
if ($response->getStatusCode() == 200) {
|
if ($response->getStatusCode() == 200) {
|
||||||
return json_decode($response->getBody())->data;
|
return json_decode($response->getBody())->data;
|
||||||
@ -78,9 +78,9 @@ trait Modules
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFreeModules()
|
public function getFreeModules($data = [])
|
||||||
{
|
{
|
||||||
$response = $this->getRemote('apps/free');
|
$response = $this->getRemote('apps/free', 'GET', $data);
|
||||||
|
|
||||||
if ($response->getStatusCode() == 200) {
|
if ($response->getStatusCode() == 200) {
|
||||||
return json_decode($response->getBody())->data;
|
return json_decode($response->getBody())->data;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user