function barang kes di admin v2
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class BarangKesController extends Controller
|
||||
{
|
||||
// lebih kurg mcm index
|
||||
public function AdminBarangKes(Request $request)
|
||||
{
|
||||
$api_url = config('api.url');
|
||||
$auth_user = Auth::user();
|
||||
// dd($api_url);
|
||||
return view('barangkes.barangkes',compact('api_url','auth_user'));
|
||||
// return view('barangkes.index', compact('data'));
|
||||
}
|
||||
|
||||
public function Detailssag(Request $request, $id)
|
||||
{
|
||||
$api_url = config('api.url');
|
||||
$auth_user = Auth::user();
|
||||
|
||||
// ambil customer info
|
||||
$customer_info = Http::get($api_url . '/admin/Customers/' . $id)->json();
|
||||
// dd($customer_info);
|
||||
// ambil gadai info (by kodcaw + norujukan dari route)
|
||||
// $gadai = null;
|
||||
if (!empty($customer_info['kodcaw']) && !empty($norujukan)) {
|
||||
$gadai = Http::get($api_url . '/api/gadai/norujukan/'
|
||||
. $customer_info['kodcaw'] . '/' . $norujukan)->json();
|
||||
}
|
||||
|
||||
$gadai = Http::get($api_url . '/api/gadai/norujukan/' . $request->kodcaw . '/' . $request->norujukan)->json();
|
||||
$gadai = $gadai[0];
|
||||
|
||||
return view('pelanggan.detailssag', compact('api_url', 'auth_user', 'customer_info', 'gadai'));
|
||||
}
|
||||
|
||||
public function store(Request $request, $id){
|
||||
|
||||
$api_url = config('api.url');
|
||||
$customer_info = Http::get($api_url . '/admin/Customers/' . $id)->json();
|
||||
// $auth_user = Auth::user();
|
||||
// dd($customer_info);
|
||||
|
||||
return view('pelanggan.detailssag', ['customer' => $customer_info,'kodcaw' => $request->query('kodcaw'),'norujukan' => $request->query('norujukan'),
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user