<?php

namespace App\Http\Controllers\Web;

use App\Models\Room;
use App\Services\Interfaces\RoomRepositoryInterface;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\View\View;

class RoomController extends Controller
{
    private $view = 'web.pages.rooms.';
    private $roomRepository ;


    public function __construct(
        RoomRepositoryInterface $roomRepository,
    )
    {
        $this->roomRepository = $roomRepository;
    }

    public function index(Request $request) :View
    {
        $rooms = $this->roomRepository->get($request);
        $title = __('web.rooms');
        return view($this->view.'index', get_defined_vars());
    }

    public function show(Room $room):View
    {
        $room = $this->roomRepository->getItem($room);
        $title = $room->name;
        return view($this->view.'details', get_defined_vars());
    }



}
