original_string: public function cities($country_id, Request $request = null)
      {
          $query = City::with([
                  'administrativeArea' => function ($q) use ($country_id) {
                      $q->where('country_id', $country_id);
                  }
              ])
              ->with('administrativeArea.country');
  
          if ($request) {
              $resource = new Collection($query, 'city', $request);
              return $this->respondWithCollection($resource);
          }
          return $query->get();
      }
code: public function cities($country_id, Request $request = null)
      {
          $query = City::with([
                  'administrativeArea' => function ($q) use ($country_id) {
                      $q->where('country_id', $country_id);
                  }
              ])
              ->with('administrativeArea.country');
  
          if ($request) {
              $resource = new Collection($query, 'city', $request);
              return $this->respondWithCollection($resource);
          }
          return $query->get();
      }
code_tokens: public function cities ( $ country_id , Request $ request = null ) { $ query = City :: with ( [ 'administrativeArea' => function ( $ q ) use ( $ country_id ) { $ q -> where ( 'country_id' , $ country_id ) ; } ] ) -> with ( 'administrativeArea.country' ) ; if ( $ request ) { $ resource = new Collection ( $ query , 'city' , $ request ) ; return $ this -> respondWithCollection ( $ resource ) ; } return $ query -> get ( ) ; }
docstring: Get country cities
  
  @param int $country_id
  @param Illuminate\Http\Request $request
  @return mixed Jnaxo\CountryCodes\City collection
docstring_tokens: Get country cities