Create Record
> App\Models\Barang::create([
. 'kode_barang' => 'PRD-G3921',
. 'nama_barang' => 'Pocky Chocolate',
. 'kategori_barang' => 'Snack',
. 'harga' => 3000,
. 'stock' => 20,
. 'sisa' => 18,
. ]);
= App\Models\Barang {#6249
kode_barang: "PRD-G3921",
nama_barang: "Pocky Chocolate",
kategori_barang: "Snack",
harga: 3000,
stock: 20,
sisa: 18,
updated_at: "2023-10-31 13:15:09",
created_at: "2023-10-31 13:15:09",
id: 1,
}
Update Record
> App\Models\Barang::where('id', 1)->update([
. 'nama_barang' => 'Pocky Chocolate Mix 5 Stick'
. ]);
= 1
Result Update by Tinker
Top comments (2)
Mantap asep
ngerii