src/CountryStore.php
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();
    }
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();
    }
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 ( ) ; }
Get country cities

@param int $country_id
@param Illuminate\Http\Request $request
@return mixed Jnaxo\CountryCodes\City collection
Get country cities