public function update($id) { // save updated $record = $this->records->find($id); if (!$record) { Condition::create(Input::all()); return $this->respond($record); } $record->fill(Input::all())->save(); return $this->respond($record); }
/** * Store a newly created resource in storage. * * @return Response */ public function store(Condition $condition, StoreCondition $request) { $condition->create($request->all()); return redirect('conditions')->with('alert-success', 'Состояние успешно добавлено!'); }