2022-09-20 19:59:52 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Content;
|
|
|
|
|
|
|
|
use App\Http\Controllers\Controller;
|
|
|
|
|
|
|
|
class ChangelogController extends Controller
|
|
|
|
{
|
2024-02-23 10:54:12 +00:00
|
|
|
public const CANNY_ENDPOINT = 'https://canny.io/api/v1/';
|
2022-09-20 19:59:52 +00:00
|
|
|
|
|
|
|
public function index()
|
|
|
|
{
|
|
|
|
return \Cache::remember('changelog_entries', now()->addHour(), function () {
|
2024-02-23 10:54:12 +00:00
|
|
|
$response = \Http::post(self::CANNY_ENDPOINT.'entries/list', [
|
2022-09-20 19:59:52 +00:00
|
|
|
'apiKey' => config('services.canny.api_key'),
|
|
|
|
'limit' => 3,
|
|
|
|
]);
|
2024-02-23 10:54:12 +00:00
|
|
|
|
2022-09-20 19:59:52 +00:00
|
|
|
return $response->json('entries');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|