Fix variable not found in blade by initializing at the backend
This commit is contained in:
@@ -31,6 +31,7 @@ class HomeController extends Controller
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
|
||||
|
||||
if(session()->has('iklan') && session()->get('iklan') == 0)
|
||||
{
|
||||
session()->put('iklan', 1);
|
||||
@@ -40,6 +41,7 @@ class HomeController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($auth_user['roles'] == 'teller'){
|
||||
if($auth_user['role_harian'] == 'teller'){
|
||||
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
@@ -55,13 +57,14 @@ class HomeController extends Controller
|
||||
}
|
||||
}
|
||||
elseif($auth_user['roles'] == 'pc' || $auth_user['roles'] == 'ppc'){
|
||||
$countkhazanah = 0;
|
||||
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
|
||||
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->get( config('api.url') .'/api/gadai/serah_marhun/khazanah/'. $auth_user['cawangan'])->json();
|
||||
$listserah = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/listSerahMarhunController/'.$auth_user['cawangan'])->json();
|
||||
|
||||
$countkhazanah = sizeof($gadai) + sizeof($listserah);
|
||||
|
||||
|
||||
return view('homepage.khazanah.home',compact('cawangan_info','api_url','countkhazanah'));
|
||||
}
|
||||
else{
|
||||
|
||||
Reference in New Issue
Block a user