Commit 4b6195aa by Yonatan Parapat
parents 0c4a4b21 eea96b68
...@@ -14,6 +14,11 @@ use App\DataRequest; ...@@ -14,6 +14,11 @@ use App\DataRequest;
use App\Pembelian; use App\Pembelian;
use App\RequestBarang;
use App\DataRequest;
class InventoriController extends Controller class InventoriController extends Controller
{ {
public function ListBarang() public function ListBarang()
...@@ -91,8 +96,22 @@ class InventoriController extends Controller ...@@ -91,8 +96,22 @@ class InventoriController extends Controller
} }
<<<<<<< HEAD
//----------------------------List Request----------------------//
public function ListRequest()
{
$request_barangs = RequestBarang::all();
return view('adminlte::inventori.ListRequest.index', compact('request_barangs'));
}
public function editRequest($id) public function editRequest($id)
{ {
=======
public function editRequest($id)
{
>>>>>>> 226a4f92be2de6ce884543bf9425346660a5031f
$request_barangs = RequestBarang::where('id', $id)->first(); $request_barangs = RequestBarang::where('id', $id)->first();
return view('adminlte::inventori.ListRequest.edit')->with('request_barangs', $request_barangs); return view('adminlte::inventori.ListRequest.edit')->with('request_barangs', $request_barangs);
} }
...@@ -131,6 +150,42 @@ class InventoriController extends Controller ...@@ -131,6 +150,42 @@ class InventoriController extends Controller
$data_requests->harga = $request['harga']; $data_requests->harga = $request['harga'];
$data_requests->save(); $data_requests->save();
return redirect('DataRequest'); return redirect('DataRequest');
<<<<<<< HEAD
}
public function editDataRequest($id)
{
$data_requests = DataRequest::where('id', $id)->first();
return view('adminlte::inventori.DataRequest.editDataRequest')->with('data_requests', $data_requests);
}
public function updateDataRequest(Request $request, $id)
{
$this->validate($request, [
'nama_barang' => 'required',
'kategori' => 'required',
'harga' => 'required',
]);
$data_requests = DataRequest::findOrFail($id);
$data_requests->nama_barang = $request->nama_barang;
$data_requests->kategori = $request->kategori;
$data_requests->harga = $request->harga;
$data_requests->save();
return redirect('DataRequest');
}
public function destroyDataRequest($id)
{
$data_requests = DataRequest::find($id);
$data_requests->delete();
return redirect('DataRequest');
=======
>>>>>>> 226a4f92be2de6ce884543bf9425346660a5031f
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment