validate([ // @todo: improve? 'id' => 'required', 'note' => 'required|string|max:500', 'type' => [ 'required', Rule::in(['asset']), ], ]); $item = Asset::findOrFail($validated['id']); // @todo: authorization event(new NoteAdded($item, Auth::user(), $validated['note'])); return redirect() ->route('hardware.show', $validated['id']) ->withFragment('history') // @todo: translate ->with('success', 'Note Added!'); } }