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.'); }
public function buildForm() { $this->add('role_name', 'text', ['label' => 'Internship Role'])->add('related_field', 'select', ['choices' => Internship::relatedFields(), 'label' => 'Related Field', 'empty_value' => 'Select'])->add('company_name', 'text', ['label' => 'Company'])->add('location', 'text', ['label' => 'Location'])->add('description', 'textarea', ['label' => 'Description', 'attr' => ['rows' => 5]])->add('comments_application', 'textarea', ['label' => 'Comments on application', 'attr' => ['rows' => 5]])->add('start_date', 'month', ['label' => 'Start Date', 'default_value' => 'YYYY-MM'])->add('end_date', 'month', ['label' => 'End Date', 'default_value' => 'YYYY-MM'])->add('submit', 'submit'); }
public function buildForm() { $this->add('filter_by', 'choice', ['choices' => Internship::relatedFields(), 'selected' => array_keys(Internship::relatedFields()), 'multiple' => true, 'expanded' => true])->add('keyword', 'text', ['label' => 'Search by keyword'])->add('submit', 'submit'); }