From c14952858bc878056c8cc46574ab83954150afbb Mon Sep 17 00:00:00 2001 From: dipta ikromi m Date: Sat, 20 Aug 2022 22:46:47 +0700 Subject: [PATCH] add kategori_simak models (Barang Controller) --- app/Http/Controllers/BarangController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/BarangController.php b/app/Http/Controllers/BarangController.php index 7d1923e..9343abe 100644 --- a/app/Http/Controllers/BarangController.php +++ b/app/Http/Controllers/BarangController.php @@ -6,6 +6,7 @@ use App\Models\JenisBarang; use App\Models\SatuanBarang; use App\Models\Pengguna; +use App\Models\KategoriSimak; use Illuminate\Support\Facades\DB; class BarangController extends Controller { @@ -31,11 +32,12 @@ public function index() $data['current_page'] = 'Data-barang'; $data['pengguna'] = Pengguna::all(); $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_kategori_simak','tbl_barang.kategori_simak_id','=','tbl_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(); $data['jenis_barang'] = jenisBarang::all(); + $data['kategori_simak'] = KategoriSimak::all(); return view('admin.barang.index',$data); }