Apps hoe page add top paid, new, top free

This commit is contained in:
Cüneyt Şentürk 2017-12-06 21:29:43 +03:00
parent 8de2439002
commit 098ed4b26a
2 changed files with 15 additions and 9 deletions

View File

@ -19,9 +19,15 @@ class Home extends Controller
{
$this->checkApiToken();
$paid = $this->getPaidModules();
$new = $this->getNewModules();
$free = $this->getFreeModules();
$data = [
'query' => [
'limit' => 4
]
];
$paid = $this->getPaidModules($data);
$new = $this->getNewModules($data);
$free = $this->getFreeModules($data);
return view('modules.home.index', compact('paid', 'new', 'free'));
}

View File

@ -56,9 +56,9 @@ trait Modules
return [];
}
public function getPaidModules()
public function getPaidModules($data = [])
{
$response = $this->getRemote('apps/paid');
$response = $this->getRemote('apps/paid', 'GET', $data);
if ($response->getStatusCode() == 200) {
return json_decode($response->getBody())->data;
@ -67,9 +67,9 @@ trait Modules
return [];
}
public function getNewModules()
public function getNewModules($data = [])
{
$response = $this->getRemote('apps/new');
$response = $this->getRemote('apps/new', 'GET', $data);
if ($response->getStatusCode() == 200) {
return json_decode($response->getBody())->data;
@ -78,9 +78,9 @@ trait Modules
return [];
}
public function getFreeModules()
public function getFreeModules($data = [])
{
$response = $this->getRemote('apps/free');
$response = $this->getRemote('apps/free', 'GET', $data);
if ($response->getStatusCode() == 200) {
return json_decode($response->getBody())->data;