proxitok/app/Controllers/DiscoverController.php

19 lines
442 B
PHP
Raw Normal View History

2022-02-05 18:58:30 -05:00
<?php
namespace App\Controllers;
use App\Helpers\ErrorHandler;
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 {
2023-04-27 14:23:23 -04:00
public static function get() {
$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
}
}
}