private function cacheIDsAndReturnUnresolvedIDs(Collection $names, Collection $ids) : Collection
    {
        $names->each(function ($name) {

            cache([$this->prefix . $name['id'] => $name['name']], carbon()->addCentury());
            $this->response[$name['id']] = $name['name'];

            UniverseName::firstOrCreate([
                'entity_id' => $name['id'],
            ], [
                'name'      => $name['name'],
                'category'  => $name['category'],
            ]);
        });

        $ids = $ids->filter(function ($id) use ($names) {

            return ! $names->contains('id', $id);
        });

        return $ids;

    }
private function cacheIDsAndReturnUnresolvedIDs(Collection $names, Collection $ids) : Collection
    {
        $names->each(function ($name) {

            cache([$this->prefix . $name['id'] => $name['name']], carbon()->addCentury());
            $this->response[$name['id']] = $name['name'];

            UniverseName::firstOrCreate([
                'entity_id' => $name['id'],
            ], [
                'name'      => $name['name'],
                'category'  => $name['category'],
            ]);
        });

        $ids = $ids->filter(function ($id) use ($names) {

            return ! $names->contains('id', $id);
        });

        return $ids;

    }
private function cacheIDsAndReturnUnresolvedIDs ( Collection $ names , Collection $ ids ) : Collection { $ names -> each ( function ( $ name ) { cache ( [ $ this -> prefix . $ name [ 'id' ] => $ name [ 'name' ] ] , carbon ( ) -> addCentury ( ) ) ; $ this -> response [ $ name [ 'id' ] ] = $ name [ 'name' ] ; UniverseName :: firstOrCreate ( [ 'entity_id' => $ name [ 'id' ] , ] , [ 'name' => $ name [ 'name' ] , 'category' => $ name [ 'category' ] , ] ) ; } ) ; $ ids = $ ids -> filter ( function ( $ id ) use ( $ names ) { return ! $ names -> contains ( 'id' , $ id ) ; } ) ; return $ ids ; }
Cache and save resolved IDs. Return unresolved collection of ids.

@param \Illuminate\Support\Collection $names resolved names
@param \Illuminate\Support\Collection $ids

@return \Illuminate\Support\Collection unresolved collection of ids
Cache and save resolved IDs . Return unresolved collection of ids .