/** * Update the specified resource in storage. * * @param int $id * * @return Response */ public function update($id, VehicleRequest $request) { $vehicle = Vehicle::findOrFail($id); $vehicle->update($request->all()); Session::flash('flash_message', 'Vehicle updated!'); return redirect('camp/vehicles'); }
/** * Update the specified resource in storage. * * @param Request $request * @param int $id * @return Response */ public function update(VehicleRequest $request, $id) { $vehicle = Vehicle::find($id); $vehicle->fill($request->all()); $success = $vehicle->save(); if ($request->ajax()) { return $success ? Response::HTTP_OK : Response::HTTP_UNPROCESSABLE_ENTITY; } }
/** * Update the specified resource in storage. * * @param VehicleRequest $request * @param int $id * @return Response */ public function update(VehicleRequest $request, $id) { $vehicle = Vehicles::findOrFail($id); if ($request->hasFile('image')) { $image_name = $request->bid . '.' . $request->file('image')->getClientOriginalExtension(); $request->file('image')->move(base_path() . '/resources/assets/images/vehicle', $image_name); $data = $request->except('image'); $data['image'] = $image_name; $vehicle->update($data); } else { $vehicle->update($request->except(['image'])); } Session::flash('success_message', 'Vehicle has been updated successfully!'); return redirect('vehicle'); }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(VehicleRequest $request, $id) { $vehicle = Vehicle::findOrFail($id); $vehicle->update($request->all()); return redirect('vehicles'); }
public function update(VehicleRequest $request, $id) { return $this->repository->updateRich($request->all(), $id); }
public function update(VehicleRequest $request, $id) { $this->repository->updateRich($request->all(), $id); flash()->success(trans('vehicles.messages.flash.update')); return Redirect::route('vehicles.index'); }