PHPackages                             ws-packages/combination-generate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ws-packages/combination-generate

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ws-packages/combination-generate
================================

Generate combinations of items in multiple arrays

v1.5.26(9mo ago)04MITPHPPHP ^7.3|^8.0

Since Aug 5Pushed 9mo agoCompare

[ Source](https://github.com/adityaoverflow/combination-generate)[ Packagist](https://packagist.org/packages/ws-packages/combination-generate)[ RSS](/packages/ws-packages-combination-generate/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Combination Generate
====================

[](#combination-generate)

[![Latest Version on Packagist](https://camo.githubusercontent.com/18ca028421a95d1e0f2eec2c30de3899c22faeda43a462be7bd6704969feb7ad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f77732d7061636b616765732f636f6d62696e6174696f6e2d67656e65726174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ws-packages/combination-generate)[![Total Downloads](https://camo.githubusercontent.com/92f5ac676ffa7ad992f854ce45ec1211567576c5acb40400facf52ed0dd7a6bd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77732d7061636b616765732f636f6d62696e6174696f6e2d67656e65726174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ws-packages/combination-generate)

A Laravel package to generate all possible combinations from multiple arrays. Perfect for creating product variants, configuration options, or any scenario where you need to combine multiple sets of values.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require ws-packages/combination-generate
```

For Laravel 5.5+ the service provider will be automatically discovered. For older versions, add the service provider to your `config/app.php`:

```
'providers' => [
    // ...
    WsPackages\CombinationGenerate\Providers\CombinationServiceProvider::class,
],
```

Usage
-----

[](#usage)

This package is designed specifically for Laravel applications and integrates seamlessly with Laravel's service container.

### Method 1: Dependency Injection (Recommended)

[](#method-1-dependency-injection-recommended)

The best way to use this package in Laravel is through dependency injection:

```
