public function updateInternship(Request $request, $id) { $form = $this->form(InternshipForm::class); $form->validate(Internship::rules(), ['dateformat' => 'Date should be a valid date of the format YYYY-MM']); if (!$form->isValid()) { return redirect()->back()->withErrors($form->getErrors())->withInput()->with('alert-warning', 'Error in form input!'); } $internship = Internship::where('id', $id)->get()->first(); $internship->update($request->all()); return redirect()->route('internlink.profile.internship.update', $id)->with('alert-success', 'Profile updated.'); }