<?php

Route::get('/', function () {
    return view('index');
});

Route::group(['middleware' => 'visitors'], function()
{
    Route::get('/register', 'RegistrationController@register');
    Route::post('/register', 'RegistrationController@postRegister');
    Route::get('/login', 'LoginController@login');
    Route::post('/login', 'LoginController@postLogin');
    Route::get('/forgot-password', 'ForgotPasswordController@forgotPassword');
    Route::post('/forgot-password', 'ForgotPasswordController@postForgotPassword');
    Route::get('/reset/{email}/{resetCode}', 'ForgotPasswordController@resetPassword');
});

Route::post('/logout', 'LoginController@logout');
//Route::get('/admin', 'AdminController@index')->middleware('admin');
Route::group(['middleware' => 'admin'], function()
{
    Route::get('/admin', 'AdminController@index');
    Route::get('/admin/pegawai', 'AdminController@pegawai');
});
Route::get('/manager', 'ManagerController@index')->middleware('manager');
Route::get('/staff', 'StaffController@index')->middleware('staff');
Route::get('/customer', 'CustomerController@index')->middleware('customer');

Route::resource('karyawan', 'KaryawanController');
