2022-02-05 18:58:30 -05:00
|
|
|
<?php
|
|
|
|
namespace App\Controllers;
|
|
|
|
|
|
|
|
use App\Helpers\ErrorHandler;
|
|
|
|
use App\Helpers\Misc;
|
2022-03-29 13:30:31 -04:00
|
|
|
use App\Helpers\Wrappers;
|
2022-02-16 09:20:35 -05:00
|
|
|
use App\Models\FeedTemplate;
|
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();
|
2022-05-24 08:10:41 -04:00
|
|
|
$feed = $api->discover();
|
2022-02-05 18:58:30 -05:00
|
|
|
if ($feed->meta->success) {
|
2022-03-29 13:30:31 -04:00
|
|
|
$latte = Wrappers::latte();
|
2022-02-16 09:20:35 -05:00
|
|
|
$latte->render(Misc::getView('discover'), new FeedTemplate('Discover', $feed));
|
2022-02-05 18:58:30 -05:00
|
|
|
} else {
|
|
|
|
ErrorHandler::show($feed->meta);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|