1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', function () {
return view('welcome');
});
Route::group(['middleware' => 'auth'], function () {
// Route::get('/link1', function () {
// // Uses Auth Middleware
// });
//Please do not remove this if you want adminlte:route and adminlte:link commands to works correctly.
#adminlte_routes
});
Route::group(['middleware' => ['web','auth']], function(){
Route::get('/home', 'HomeController@index');
Route::get('/', function () {
// if(Auth::user()->role == 'admin'){
// return view('adminlte::home');
// } elseif(Auth::user()->role == 'customer'){
// return redirect()->intended('user_home');
// } elseif(Auth::user()->role == 'kasir'){
// return redirect()->intended('kasir');
// } elseif(Auth::user()->role == 'inventori'){
// return redirect()->intended('inventori');
// }
// else {
// return redirect()->intended('pelayan');
// }
// if (Auth::user()->role=='admin'){
// return view('adminlte::admin');
// }else if(Auth::user()->role=='user'){
// return view('adminlte::user_home');
// }else if(Auth::user()->role=='kasir'){
// return view('adminlte::kasir');
// }
if (Auth::user()->status=='admin'){
return view('adminlte::admin.index');
}else if(Auth::user()->status=='user'){
return view('adminlte::customer.index');
}else if(Auth::user()->status=='kasir'){
return view('adminlte::kasir.index');
}else if(Auth::user()->status=='inventori'){
return view('adminlte::inventori.index');
}
});
});
// Route::group(['middleware' => ['web','auth','admin']], function () {
// Route::get('/daftarPegawai', 'OrderController@index');
// });