original_string: public function setDefault(Request $request)
      {
          try {
              $address = Auth::user()->findAddress($request->id);
          } catch(\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
              return $this->respondsWithError(trans('address.errors.model_not_found'));
          }
  
          Auth::user()->resetDefaultAddress();
  
          $address->update(['default' => true]);
  
          return $this->respondsWithSuccess('', route('addressBook.index'));
      }
code: public function setDefault(Request $request)
      {
          try {
              $address = Auth::user()->findAddress($request->id);
          } catch(\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
              return $this->respondsWithError(trans('address.errors.model_not_found'));
          }
  
          Auth::user()->resetDefaultAddress();
  
          $address->update(['default' => true]);
  
          return $this->respondsWithSuccess('', route('addressBook.index'));
      }
code_tokens: public function setDefault ( Request $ request ) { try { $ address = Auth :: user ( ) -> findAddress ( $ request -> id ) ; } catch ( \ Illuminate \ Database \ Eloquent \ ModelNotFoundException $ e ) { return $ this -> respondsWithError ( trans ( 'address.errors.model_not_found' ) ) ; } Auth :: user ( ) -> resetDefaultAddress ( ) ; $ address -> update ( [ 'default' => true ] ) ; return $ this -> respondsWithSuccess ( '' , route ( 'addressBook.index' ) ) ; }
docstring: Setting to default a given address.
  
  @param Request $request
docstring_tokens: Setting to default a given address .