$device]); } public function store(Device $device, Request $request) { $formFields = $request->validate([ 'rz_username' => 'required', 'timestamp_owner_since' => 'required' ]); $formFields['device_id'] = $device->device_id; OwnerTransaction::create($formFields); Log::info('Owner saved successfully'); return redirect('/'); } public function edit(OwnerTransaction $owner) { $this->authorize('admin-only'); return view('owners.edit', ['owner' => $owner]); } public function update(OwnerTransaction $owner, Request $request) { $this->authorize('admin-only'); $formFields = $request->validate([ 'rz_username' => 'required', 'timestamp_owner_since' => 'required' ]); $owner->update($formFields); Log::info('Owner updated successfully'); return redirect('/'); } public function destroy(OwnerTransaction $owner) { $this->authorize('admin-only'); $owner->delete(); Log::info('Owner deleted successfully'); return back(); } }