2026-05-06 10:47:44 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Fo;
|
|
|
|
|
|
|
|
|
|
use App\Http\Controllers\Controller;
|
2026-05-13 13:16:28 +02:00
|
|
|
use App\Lib\Helpers\GamePeriodHelper;
|
2026-05-06 10:47:44 +02:00
|
|
|
use App\Models\GoldenCrushGame;
|
2026-09-25 16:25:31 +02:00
|
|
|
use Illuminate\Contracts\View\View;
|
2026-05-06 10:47:44 +02:00
|
|
|
|
|
|
|
|
class GoldenCrushController extends Controller
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Reuturn landing page.
|
|
|
|
|
*/
|
2026-09-25 16:25:31 +02:00
|
|
|
public function index(): View
|
2026-05-06 10:47:44 +02:00
|
|
|
{
|
2026-05-13 13:16:28 +02:00
|
|
|
$startVote = GamePeriodHelper::isGamePeriod();
|
2026-09-25 16:25:31 +02:00
|
|
|
|
2026-05-13 13:16:28 +02:00
|
|
|
return view('fo.pages.goldenCrush.golden-crush', ['startVote' => $startVote]);
|
2026-05-06 10:47:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* End of participation landing page.
|
|
|
|
|
*/
|
2026-09-25 16:25:31 +02:00
|
|
|
public function endParticipation(): View
|
2026-05-06 10:47:44 +02:00
|
|
|
{
|
|
|
|
|
return $this->render('fo.pages.goldenCrush.end-of-participation');
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-25 16:25:31 +02:00
|
|
|
/**
|
|
|
|
|
* End of game landing page.
|
|
|
|
|
*/
|
|
|
|
|
public function endGame(): View
|
2026-05-06 10:47:44 +02:00
|
|
|
{
|
|
|
|
|
return $this->render('fo.pages.goldenCrush.end-game');
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-25 16:25:31 +02:00
|
|
|
/**
|
|
|
|
|
* Render video in view.
|
|
|
|
|
*
|
|
|
|
|
* @param string $view for inject videos.
|
|
|
|
|
*/
|
|
|
|
|
private function render(string $view): View
|
2026-05-06 10:47:44 +02:00
|
|
|
{
|
|
|
|
|
$videos = GoldenCrushGame::getVideos();
|
|
|
|
|
|
|
|
|
|
return view($view, compact('videos'));
|
|
|
|
|
}
|
|
|
|
|
}
|