public static function generation(Collection $categories) : Collection
	{
		$ids = [];

		foreach ($categories as $category) {
			$ids[] = $category->id;
			$ids[] = static::familyTree($category->childrenRecursive);
		}

        return Collection::make($ids)->flatten()->unique()->sort();
	}
public static function generation(Collection $categories) : Collection
	{
		$ids = [];

		foreach ($categories as $category) {
			$ids[] = $category->id;
			$ids[] = static::familyTree($category->childrenRecursive);
		}

        return Collection::make($ids)->flatten()->unique()->sort();
	}
public static function generation ( Collection $ categories ) : Collection { $ ids = [ ] ; foreach ( $ categories as $ category ) { $ ids [ ] = $ category -> id ; $ ids [ ] = static :: familyTree ( $ category -> childrenRecursive ) ; } return Collection :: make ( $ ids ) -> flatten ( ) -> unique ( ) -> sort ( ) ; }
Returns the generation ids for the given categories.

@param  Collection $categories
@return array
Returns the generation ids for the given categories .