Get First Data
> App\Models\Barang::first();
= App\Models\Barang {#6247
id: 1,
kode_barang: "PRD-G3921",
nama_barang: "Pocky Chocolate Mix 5 Stick",
kategori_barang: "Snack",
harga: 3000,
stock: 20,
sisa: 18,
created_at: "2023-10-31 13:15:09",
updated_at: "2023-10-31 13:17:31",
}
Get All data
> App\Models\Barang::all();
= Illuminate\Database\Eloquent\Collection {#6240
all: [
App\Models\Barang {#6250
id: 1,
kode_barang: "PRD-G3921",
nama_barang: "Pocky Chocolate Mix 5 Stick",
kategori_barang: "Snack",
harga: 3000,
stock: 20,
sisa: 18,
created_at: "2023-10-31 13:15:09",
updated_at: "2023-10-31 13:17:31",
},
],
}
Top comments (0)