2022-02-05 18:58:30 -05:00
|
|
|
<?php
|
|
|
|
namespace App\Controllers;
|
|
|
|
|
|
|
|
use App\Helpers\ErrorHandler;
|
2022-03-29 13:30:31 -04:00
|
|
|
use App\Helpers\Wrappers;
|
2023-01-26 13:21:14 -05:00
|
|
|
use App\Models\DiscoverTemplate;
|
2022-02-05 18:58:30 -05:00
|
|
|
|
|
|
|
class DiscoverController {
|
|
|
|
static public function get() {
|
2022-03-29 13:30:31 -04:00
|
|
|
$api = Wrappers::api();
|
2023-01-26 13:21:14 -05:00
|
|
|
$data = $api->discover();
|
|
|
|
if ($data->meta->success) {
|
|
|
|
Wrappers::latte('discover', new DiscoverTemplate($data));
|
2022-02-05 18:58:30 -05:00
|
|
|
} else {
|
2023-01-26 13:21:14 -05:00
|
|
|
ErrorHandler::showMeta($data->meta);
|
2022-02-05 18:58:30 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|