PageRenderTime 24ms CodeModel.GetById 17ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/src/www/rooms/controllers/ListController.php

https://bitbucket.org/mdoviedor/hotelium
PHP | 41 lines | 18 code | 6 blank | 17 comment | 0 complexity | b03c0b5ce6712c38fb234ffd2fa955aa MD5 | raw file
 1<?php
 2/**
 3 * Created by PhpStorm.
 4 * User: marlon
 5 * Date: 8/02/18
 6 * Time: 09:02 PM.
 7 */
 8
 9namespace www\rooms\controllers;
10
11use repositories\RoomRepository;
12
13class ListController
14{
15    /**
16     * @var RoomRepository
17     */
18    private $roomRepository;
19
20    /**
21     * ListController constructor.
22     *
23     * @param RoomRepository $roomRepository
24     */
25    public function __construct(RoomRepository $roomRepository)
26    {
27        $this->roomRepository = $roomRepository;
28    }
29
30    /**
31     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
32     */
33    public function __invoke()
34    {
35        $rooms = $this->roomRepository->paginate();
36
37        return view('rooms::list', [
38            'rooms' => $rooms,
39        ]);
40    }
41}