<?php

namespace App\Http\Controllers;

use App\Models\Game;
use App\Models\Setting;

class WelcomeController  extends Controller
{

    public function index()
    {
        $notification = Setting::where('key', 'notification')
            ->pluck('value')->first() ?? '';

        $games = Game::latest()->paginate(50);

        $currentRunningGame = $games->where('win_number', null)->first();

        return view('welcome', compact('games', 'notification', 'currentRunningGame'));
    }
}
