$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); 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); return redirect('/'); } public function destroy(OwnerTransaction $owner) { $this->authorize('admin-only'); $owner->delete(); return back(); } }