/**
  * 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');
 }
Exemplo n.º 2
0
 /**
  * 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;
     }
 }
Exemplo n.º 3
0
 /**
  * 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');
 }
Exemplo n.º 4
0
 /**
  * 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');
 }