37 lines
1.1 KiB
PHP
37 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Http;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
class PenebusanController extends Controller
|
|
{
|
|
public function __construct()
|
|
{
|
|
$this->middleware('auth');
|
|
}
|
|
|
|
public function index($norujukan){
|
|
$auth_user = Auth::user();
|
|
$api_url = config('api.url');
|
|
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
|
|
|
$gadaidetail = Http::get(config('api.url') . '/api/gadai/norujukan/'. $norujukan)->json();
|
|
$noic = $gadaidetail[0][0]['nokp'];
|
|
$customerdetail = Http::get(config('api.url') . '/api/customers/'. $noic)->json();
|
|
$marhundetail = Http::get(config('api.url') . '/api/marhun/'. $norujukan)->json();
|
|
|
|
// dd($marhundetail[0]);
|
|
|
|
$marhun = $marhundetail[0];
|
|
$nama = $customerdetail[0]['nama'];
|
|
|
|
$gadai = $gadaidetail[0][0];
|
|
|
|
|
|
return view('penebusan.index',compact('cawangan_info','api_url','gadai','marhun','nama'));
|
|
}
|
|
}
|