This commit is contained in:
LAPTOP-DGCU80CH\user1
2020-11-08 15:58:31 +08:00
parent 0b35f899a1
commit b50b8b5109
6 changed files with 242 additions and 113 deletions
+4 -3
View File
@@ -29,7 +29,8 @@ class CustomersController extends Controller
$search = false;
$auth_user = Auth::user();
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
return view('customers.index',compact('search','cawangan_info'));
$bank = Http::get(config('api.url') . '/api/bank')->json();
return view('customers.index',compact('search','cawangan_info','bank'));
}
public function info(){
@@ -43,7 +44,7 @@ class CustomersController extends Controller
$auth_user = Auth::user();
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
$bank = Http::get(config('api.url') . '/api/bank')->json();
$customers_info = Http::get(config('api.url') . '/api/customers/'. $noic)->json();
if($customers_info){
$customer_info = $customers_info[0];
@@ -56,7 +57,7 @@ class CustomersController extends Controller
Session::put('customer_info',$customer_info);
return redirect()->route('customer_info')->with( ['customer_info' => $customer_info,'cawangan_info'=>$cawangan_info]);
}else{
return view('customers.index',compact('customer_info','search','noic','cawangan_info'));
return view('customers.index',compact('customer_info','search','noic','cawangan_info','bank'));
}
}