/** * Creates a note for the specified inventory. * * @param NoteRequest $request * @param int|string $id * * @return \Illuminate\Http\RedirectResponse */ public function store(NoteRequest $request, $id) { $note = $this->inventory->createNote($request, $id); if ($note) { $message = 'Successfully created note.'; return redirect()->route('maintenance.inventory.show', [$id])->withSuccess($message); } else { $message = 'There was an issue creating a note. Please try again.'; return redirect()->route('maintenance.inventory.notes.create', [$id])->withErrors($message); } }