wi-adrema-plugin/support/FetchAllEvents.php

22 lines
399 B
PHP

<?php
namespace Silva\Adrema\Support;
use Illuminate\Support\Collection;
use Cache;
class FetchAllEvents
{
public function run(): ?Collection
{
$events = Cache::remember('adrema-all-events', 3600, function () {
return app(Proxy::class)->run('/api/form');
});
if (!$events) {
return null;
}
return collect($events);
}
}