add login role

This commit is contained in:
LAPTOP-DGCU80CH\user1
2020-11-23 10:04:25 +08:00
parent b50b8b5109
commit 9fcbcae462
15 changed files with 199 additions and 28 deletions
+15 -2
View File
@@ -28,7 +28,20 @@ class HomeController extends Controller
public function index()
{
$auth_user = Auth::user();
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
return view('homepage.home',compact('cawangan_info'));
if($auth_user['roles'] == 'teller'){
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
return view('homepage.'.$auth_user['roles'].'.home',compact('cawangan_info'));
}elseif($auth_user['roles'] == 'penilai'){
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
return view('homepage.'.$auth_user['roles'].'.home',compact('cawangan_info'));
}
elseif($auth_user['roles'] == 'khazanah'){
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
return view('homepage.'.$auth_user['roles'].'.home',compact('cawangan_info'));
}
elseif($auth_user['roles'] == 'operasi'){
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
return view('homepage.'.$auth_user['roles'].'.home',compact('cawangan_info'));
}
}
}