Пример #1
0
 public function postUpdatePaymentAddressCustomer(Requests\UpdateCustomerRequest $request)
 {
     $user = Session::get('user');
     DB::beginTransaction();
     try {
         //update account
         $account = User::where('id', $user['id'])->update(['phone' => $request->input('phone')]);
         //update customer
         $cus = Customer::where('id', $request->input('id'))->update(['address1' => $request->input('address1'), 'address2' => $request->input('address2'), 'city_id' => $request->input('city_id'), 'state_id' => $request->input('state_id')]);
         DB::commit();
         return redirect_success('FrontendController@index', 'success', 'Your information changed!');
     } catch (\Exception $e) {
         DB::rollback();
         return redirect_errors('Cannot update information!');
     }
 }