<?php

namespace App\Http\Controllers\Epelcon;

use App\Http\Controllers\Controller;
use App\Models\Room;
use Illuminate\Http\Request;

class QrController extends Controller
{
    public function index(Request $request)
    {
        $rooms = Room::orderBy('number')->get(['id', 'number']);
        $tables = min(60, max(1, (int) $request->input('tables', 12)));

        return view('epelcon.qr.index', compact('rooms', 'tables'));
    }
}
