public function storeSection(SectionRequest $request) { Section::create($request->all()); flash()->success('Sekcja <b>' . $request->input('name') . '</b> dla zapytań została dodana!'); return redirect('/admin'); }
/** * Update the specified resource in storage. * * @param int $id * @param SectionRequest $request * @return Response */ public function update($id, SectionRequest $request) { $section = $this->section->find($id); if (is_null($section)) { return redirect()->route('section.index')->with('error', 'Section not found.'); } if ($section->update($request->all())) { return redirect('section')->with('success', 'Section successfully updated!'); } return redirect('section')->with('error', 'Problem updating Section!'); }