30 lines
967 B
PHP
30 lines
967 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use App\Services\CustomerService;
|
|
use Illuminate\Support\Facades\Session;
|
|
use Illuminate\Support\Facades\Http;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
class GadaianController extends Controller
|
|
{
|
|
public function __construct()
|
|
{
|
|
$this->middleware('auth');
|
|
$this->customerService = New CustomerService();
|
|
}
|
|
|
|
public function index(Request $request)
|
|
{
|
|
$noic = $request->noic;
|
|
$customer_info = Http::get(config('api.url') . '/api/customers/'. $noic)->json();
|
|
// $limit_pinjaman_semasa = $customer_info['limit_pinjaman'] - $customer_info['pinjaman_semasa'];
|
|
$limit_pinjaman_semasa = 0;
|
|
$auth_user = Auth::user();
|
|
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
|
return view('gadaian.index',compact('customer_info','limit_pinjaman_semasa','cawangan_info'));
|
|
}
|
|
}
|