validated()); return redirect()->route('mata_pelajarans.index')->with('success', 'Mata pelajaran berhasil ditambahkan'); } /** * Display the specified resource. */ public function show(MataPelajaran $mataPelajaran) { // } /** * Show the form for editing the specified resource. */ public function edit(MataPelajaran $mataPelajaran) { return view('mata_pelajarans.edit', compact('mataPelajaran')); } /** * Update the specified resource in storage. */ public function update(UpdateMataPelajaranRequest $request, MataPelajaran $mataPelajaran) { $mataPelajaran->update($request->validated()); return redirect()->route('mata_pelajarans.index')->with('success', 'Mata pelajaran berhasil diupdate'); } /** * Remove the specified resource from storage. */ public function destroy(MataPelajaran $mataPelajaran) { $mataPelajaran->delete(); return redirect()->route('mata_pelajarans.index')->with('success', 'Mata pelajaran berhasil dihapus'); } }