From 5e95df1654d0cebff29321123d0caeeb28545bda Mon Sep 17 00:00:00 2001 From: dipta ikromi m Date: Sat, 20 Aug 2022 22:31:39 +0700 Subject: [PATCH] Join tbl_kategori_simak ke tbl_barang (Barang Controller) --- app/Http/Controllers/BarangController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/BarangController.php b/app/Http/Controllers/BarangController.php index 1dfc908..7d1923e 100644 --- a/app/Http/Controllers/BarangController.php +++ b/app/Http/Controllers/BarangController.php @@ -30,7 +30,8 @@ public function index() $data['menu'] = 'Manajemen Barang'; $data['current_page'] = 'Data-barang'; $data['pengguna'] = Pengguna::all(); - $data['barang'] = Barang::join('tbl_satuan','tbl_satuan.id','=','tbl_barang.satuan_id') + $data['barang'] = Barang::join('tbl_satuan','tbl_satuan.id','=','tbl_barang.satuan_id') + ->join('tbl_kategori_simak','tbl_kategori_simak.id','=','tbl_barang.kategori_simak.id') ->join('tbl_jenis_barang','tbl_jenis_barang.id','=','tbl_barang.jenis_barang_id') ->get(['tbl_barang.*','tbl_satuan.nama_satuan','tbl_jenis_barang.nama_jenis']); $data['satuan_barang'] = SatuanBarang::all();