/** * Handle the creation of a new trick. * * @return \Illuminate\Http\RedirectResponse */ public function postNew() { $form = $this->trick->getCreationForm(); if (!$form->isValid()) { return $this->redirectBack(['errors' => $form->getErrors()]); } $data = $form->getInputData(); $data['user_id'] = Auth::user()->id; $trick = $this->trick->create($data); return $this->redirectRoute('user.index'); }