<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Routing\Route;
use Illuminate\Support\Facades\Auth;

class HomeController extends Controller
{
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('auth');
    }

    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Contracts\Support\Renderable
     */
    public function index()
    {
        if(Auth::user()->nivel == 1){
            return redirect()->route('cadastrador.home');
        }if(Auth::user()->nivel == 2){
            return redirect()->route('funcionario.home');
        }else{
            return view('solicitante.index');
        }
    }
}
