authorize('admin-only'); return view('purchasings.edit', ['purchasing' => $device->purchasing]); } public function update(Device $device, Request $request) { $this->authorize('admin-only'); $formFields = $request->validate([ 'price' => 'required', 'timestamp_warranty_end' => 'required', 'timestamp_purchase' => 'required', 'cost_centre' => 'required', ]); $device->purchasing->update($formFields); Log::info('Purchasing Information updated successfully'); return redirect('/'); } }