<?php

namespace App\Modules\Bookings;

use Illuminate\Support\Facades\View;
use App\Models\User;
use App\Models\Severity;
use App\Http\Controllers\BaseController;

class AbstractPageController extends BaseController
{
    /**
     *	The layout that should be used for responses.
     */
    protected $layout = 'layouts.master';

    /**
     * Data to be passed to the view.
     *
     * @var array
     */
    protected $data = [];

    public function loadData()
    {
        $severities = [];
        foreach (Severity::all() as $severity) {
            $severities[$severity->id] = $severity->name;
        }

        $this->data = [
            'users'      => User::getActiveList(),
            'severities' => $severities,
        ];
    }
}
