get(); return view('employee.pages.weight.index', compact('weights')); } public function create(): View { return view('employee.pages.weight.create'); } public function store(WeightRequest $request): RedirectResponse { // * Create the weight Weight::create([ 'weight' => $request->weight, ]); // * Notification $notification = [ 'message' => 'Bobot telah berhasil ditambahkan', 'alert-type' => 'info', ]; return redirect()->route('weights')->with($notification); } public function edit(Weight $weights): View { return view('employee.pages.weight.edit', compact('weights')); } public function update(WeightRequest $request, Weight $weights): RedirectResponse { // * Update the weight $weights->update([ 'weight' => $request->weight, ]); // * Notification $notification = [ 'message' => 'Bobot telah berhasil diperbarui', 'alert-type' => 'info', ]; return redirect()->route('weights')->with($notification); } public function destroy(Weight $weights): RedirectResponse { // * Delete the weight $weights->delete(); // * Notification $notification = [ 'message' => 'Bobot telah berhasil dihapus', 'alert-type' => 'info', ]; return redirect()->route('weights')->with($notification); } }