|
|
@ -22,7 +22,7 @@ class PeminjamanApiController extends Controller |
|
|
|
|
|
|
|
|
|
|
|
public function show($id) |
|
|
|
public function show($id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$peminjaman = asset_status::with(['peti', 'warehouse'])->find($id); |
|
|
|
$peminjaman = asset_status::with(['peti.customer', 'peti.tipe_peti', 'warehouse'])->find($id); |
|
|
|
|
|
|
|
|
|
|
|
return ResponseFormatter::success([ |
|
|
|
return ResponseFormatter::success([ |
|
|
|
'message' => 'Data peminjaman berhasil diambil ID', |
|
|
|
'message' => 'Data peminjaman berhasil diambil ID', |
|
|
@ -32,12 +32,22 @@ class PeminjamanApiController extends Controller |
|
|
|
|
|
|
|
|
|
|
|
public function store(Request $request) |
|
|
|
public function store(Request $request) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
$this->validate($request, [ |
|
|
|
|
|
|
|
'peti_id' => 'required', |
|
|
|
|
|
|
|
'exit_at' => 'required', |
|
|
|
|
|
|
|
'exit_pic' => 'required', |
|
|
|
|
|
|
|
'exit_warehouse' => 'required', |
|
|
|
|
|
|
|
'est_pengembalian' => 'required', |
|
|
|
|
|
|
|
'created_by' => 'required', |
|
|
|
|
|
|
|
'updated_by' => 'required', |
|
|
|
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
|
|
$peminjaman = asset_status::create([ |
|
|
|
$peminjaman = asset_status::create([ |
|
|
|
'asset_id' => $request->asset_id, |
|
|
|
'peti_id' => $request->peti_id, |
|
|
|
'exit_at' => $request->exit_at, |
|
|
|
'exit_at' => $request->exit_at, |
|
|
|
'exit_pic' => $request->exit_pic, |
|
|
|
'exit_pic' => $request->exit_pic, |
|
|
|
'exit_warehouse' => $request->exit_warehouse, |
|
|
|
'exit_warehouse' => $request->exit_warehouse, |
|
|
|
|
|
|
|
'est_pengembalian' => $request->est_pengembalian, |
|
|
|
'created_by' => $request->created_by, |
|
|
|
'created_by' => $request->created_by, |
|
|
|
'updated_by' => $request->updated_by, |
|
|
|
'updated_by' => $request->updated_by, |
|
|
|
]); |
|
|
|
]); |
|
|
|