Created
August 2, 2025 08:22
-
-
Save sulemani39/9b7481b92737629664a6440fc7eabbc7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function index() | |
{ | |
$produk = Produk::all(); | |
return view('produk.index', compact('produk')); | |
} | |
public function store(Request $request) | |
{ | |
$request->validate([ | |
'nama' => 'required', | |
'harga' => 'required|numeric', | |
]); | |
Produk::create($request->all()); | |
return redirect('/produk')->with('sukses', 'Produk berhasil disimpan'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment