ldc-legaulois/app/Http/Controllers/Fo/GoldenCrushController.php
2026-05-13 13:16:28 +02:00

54 lines
1.3 KiB
PHP

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