/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update(Request $request, $id) { $v = \Validator::make($request->all(), $this->form_rules); if ($v->fails()) { return \Response::json(['success' => false, 'message' => trans('address.error_validation'), 'class' => 'alert alert-danger']); } $address = Address::find($id); $address->fill($request->all()); $address->save(); if ($address) { \Session::put('message', trans('address.success_update')); \Session::save(); return \Response::json(['success' => true, 'callback' => '/user/address']); } else { return \Response::json(['success' => false, 'message' => trans('address.error_updating'), 'class' => 'alert alert-danger']); } }