diff --git a/Http/Controllers/FrontendController.php b/Http/Controllers/FrontendController.php index 2528edb..f540e16 100644 --- a/Http/Controllers/FrontendController.php +++ b/Http/Controllers/FrontendController.php @@ -54,6 +54,34 @@ return view('frontend::index', compact('kurs', 'usd', 'date', 'platform')); } + public function ont() + { + $json = File::get('storage/kurs.json'); + $kurs = json_decode($json); + if($kurs->date != date('Y-m-d')){ + $this->getKurs(); + } + + $json = File::get('storage/kurs.json'); + $kurs = json_decode($json); + $usd = $kurs->rates->IDR/$kurs->rates->USD; + $date = Carbon::createFromTimestamp($kurs->timestamp)->locale('id')->setTimezone('Asia/Jakarta')->translatedFormat('d F Y H:i:s'); + + $sheets = Sheets::spreadsheet('1c2Uv3QVTyLzsJPE4uqqlMGNKO8z0Kqj6aEGh0uixAqA')->sheet('Platform')->range('A:F')->get(); + $header = $sheets->pull(0); + $posts = Sheets::collection($header, $sheets); + $posts = $posts->take(5000); + $data = new Collection($posts->toArray()); + $platform = $data->random(5); + + return view('frontend::ont', compact('kurs', 'usd','date','platform')); + } + + public function press() + { + return view('frontend::press-release'); + } + public function cakupan() {