<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', 'WelcomeController@index');

Route::get('home', 'HomeController@index');

Route::resource('employee','EmployeesController');
Route::resource('guardian','GuardiansController');

Route::resource('visitor','VisitorsController');

Route::resource('log','LogsController');

Route::get('statistic/index', 'StatisticsController@index');
Route::get('statistic/statisticLogOutPerMonth', 'StatisticsController@statisticLogOutPerMonth');
Route::get('statistic/statisticLogInPerMonth', 'StatisticsController@statisticLogInPerMonth');

// Staff Service
Route::post('staff-service/authentify','StaffServiceController@authentify');
Route::group(['middleware'=>'staff.token'],function() {
    Route::post('staff-service/editProfile', 'StaffServiceController@editProfile');
    Route::post('staff-service/renderLogs', 'StaffServiceController@renderLogs');
    Route::post('staff-service/updateProfile', 'StaffServiceController@updateProfile');
    Route::post('staff-service/renderKey', 'StaffServiceController@renderKey');

});
Route::get('staff-service/download/{cin}','StaffServiceController@download');
// Guardian Service
Route::post('guard-service/authentify','GuardServiceController@authentify');
Route::group(['middleware'=>'guard.token'],function(){
    Route::post('guard-service/identify','GuardServiceController@identify');
    Route::post('guard-service/renderLogs','GuardServiceController@renderLogs');
    Route::post('guard-service/logger','GuardServiceController@logger');
    Route::post('guard-service/renderVisitors','GuardServiceController@renderVisitors');
    Route::post('guard-service/renderProfiles','GuardServiceController@renderProfiles');
    Route::post('guard-service/saveLog','GuardServiceController@saveLog');
});


Route::controllers([
	'auth' => 'Auth\AuthController',
	'password' => 'Auth\PasswordController',
]);
