<?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.
|
*/

// Home
// Route::get('/', ['uses' => 'HomeController@GET_index', 'as' => '_home']);
Route::get('/', ['uses' => 'AuthController@GET_login', 'as' => '_home']);

Route::get('/login', ['uses' => 'AuthController@GET_login', 'as' => '_auth.login']);
Route::post('/login', ['uses' => 'AuthController@postLogin', 'as' => '_auth.login.post']);
Route::get('/logout', ['uses' => 'AuthController@getLogout', 'as' => '_auth.logout']);

//-- Authentication Routes --//
Route::get('/admin', ['uses' => 'AdminController@GET_index', 'as' => 'admin']);
// Create User
Route::get(		'/user/list', 			['as' => 'user.list', 					'uses' => 'UserController@GET_listUser']);
Route::get(		'/user/create', 		['as' => 'user.create', 				'uses' => 'UserController@GET_createUserForm']);
Route::post(	'/user/create', 		['as' => 'user.create.post', 			'uses' => 'UserController@POST_createUser']);
Route::get(		'/user/update/{id}', 	['as' => 'user.update', 				'uses' => 'UserController@GET_updateUserForm']);
Route::put(		'/user/update/{id}', 	['as' => 'user.update.put', 			'uses' => 'UserController@PUT_updateUser']);
Route::delete(	'/user/delete/{id}', 	['as' => 'user.delete', 				'uses' => 'UserController@DELETE_deleteUser']);

// Create Group
Route::delete(	'/group/delete/{id}', 	['as' => 'group.delete', 				'uses' => 'GroupController@DELETE_deleteGroup']);
Route::get(		'/group/create', 		['as' => 'group.create', 				'uses' => 'GroupController@GET_createGroupForm']);
Route::post(	'/group/create', 		['as' => 'group.create.post',		 	'uses' => 'GroupController@POST_createGroup']);
Route::get(		'/group/assign', 		['as' => 'group.assign', 				'uses' => 'GroupController@GET_assignGroupForm']);
Route::post(	'/group/assign/{id}', 	['as' => 'group.assign.post', 			'uses' => 'GroupController@POST_assignGroup']);

// Create Karyawan 
Route::get(		'/pegawai/list', 		['as' => 'pegawai.list', 				'uses' => 'PegawaiController@GET_listUser']);
Route::get(		'/pegawai/create', 		['as' => 'pegawai.create', 				'uses' => 'PegawaiController@GET_createUserForm']);
Route::post(	'/pegawai/create', 		['as' => 'pegawai.create.post', 		'uses' => 'PegawaiController@POST_createUser']);
Route::get(		'/pegawai/update/{id}', 	['as' => 'pegawai.update', 			'uses' => 'PegawaiController@GET_updateUserForm']);
Route::put(		'/pegawai/update/{id}', 	['as' => 'pegawai.update.put', 		'uses' => 'PegawaiController@PUT_updateUser']);
Route::delete(	'/pegawai/delete/{id}', 	['as' => 'pegawai.delete', 			'uses' => 'PegawaiController@DELETE_deleteUser']);


// Create Absensi
Route::get(		'/absensi/list', 		['as' => 'absensi.list', 				'uses' => 'AbsensiController@GET_listUser']);
Route::get(		'/absensi/create', 		['as' => 'absensi.create', 				'uses' => 'AbsensiController@GET_createUserForm']);
Route::post(	'/absensi/create', 		['as' => 'absensi.create.post', 		'uses' => 'AbsensiController@POST_createUser']);
Route::get(		'/absensi/update/{id}', 	['as' => 'absensi.update', 			'uses' => 'AbsensiController@GET_updateUserForm']);
Route::put(		'/absensi/update/{id}', 	['as' => 'absensi.update.put', 		'uses' => 'AbsensiController@PUT_updateUser']);
Route::delete(	'/absensi/delete/{id}', 	['as' => 'absensi.delete', 			'uses' => 'AbsensiController@DELETE_deleteUser']);
Route::post( '/absensi/filter', 			['as' => 'absensi.list.filter',    'uses' => 'AbsensiController@FilterAbsensi']);