PHPackages                             madeitbelgium/spintax - 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. madeitbelgium/spintax

ActiveLibrary

madeitbelgium/spintax
=====================

Generate multiple artikels based on one text.

1.4.0(3y ago)82.2k↓100%4[1 issues](https://github.com/madeITBelgium/Spintax/issues)MITPHPPHP &gt;=5.6

Since Jan 20Pushed 3y ago1 watchersCompare

[ Source](https://github.com/madeITBelgium/Spintax)[ Packagist](https://packagist.org/packages/madeitbelgium/spintax)[ GitHub Sponsors](https://github.com/madeitbelgium)[ RSS](/packages/madeitbelgium-spintax/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (7)Used By (0)

PHP Spintax
===========

[](#php-spintax)

[![Build Status](https://camo.githubusercontent.com/1fc10744b95e72dcd99d82d86d97855433343afc502bdef894e054a97350bbe8/68747470733a2f2f7472617669732d63692e6f72672f6d616465495442656c6769756d2f5370696e7461782e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/madeITBelgium/Spintax)[![Coverage Status](https://camo.githubusercontent.com/d06f21eba4b8ca5b422e13c93c31568569d260506e75a1643ee659b923a25b26/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d616465495442656c6769756d2f5370696e7461782f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/madeITBelgium/Spintax?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/e35c02c3891fca57e79d083999f83033b67456b81383fc4b0e14225528343154/68747470733a2f2f706f7365722e707567782e6f72672f6d616465495442656c6769756d2f5370696e7461782f762f737461626c652e737667)](https://packagist.org/packages/madeITBelgium/Spintax)[![Latest Unstable Version](https://camo.githubusercontent.com/cca9bf44dafce7dd3256ede7235f51fb02e481c0cb5061fecdebfe7f70b59146/68747470733a2f2f706f7365722e707567782e6f72672f6d616465495442656c6769756d2f5370696e7461782f762f756e737461626c652e737667)](https://packagist.org/packages/madeITBelgium/Spintax)[![Total Downloads](https://camo.githubusercontent.com/b86bb27da053c42b1e9edcf81c5137d67e7f8cab82fc7d67dd10b3300b310fec/68747470733a2f2f706f7365722e707567782e6f72672f6d616465495442656c6769756d2f5370696e7461782f642f746f74616c2e737667)](https://packagist.org/packages/madeITBelgium/Spintax)[![License](https://camo.githubusercontent.com/81cb1a48d1b2b955947c8ae8882469968028916820d7686662dd9bceb85d7f99/68747470733a2f2f706f7365722e707567782e6f72672f6d616465495442656c6769756d2f5370696e7461782f6c6963656e73652e737667)](https://packagist.org/packages/madeITBelgium/Spintax)

With this (Laravel) package you can create multiple articles based on a single text. A forked and extended version of

Installation
============

[](#installation)

Require this package in your `composer.json` and update composer.

```
"madeitbelgium/spintax": "~1.0"
```

Documentation
=============

[](#documentation)

Usage
-----

[](#usage)

### Get a random spin

[](#get-a-random-spin)

```
use MadeITBelgium\Spintax\SpintaxFacade as Spintax;

Spintax::parse('Your {text|content} here.')->generate();
```

```
use MadeITBelgium\Spintax\SpintaxFacade as Spintax;

$spintax = Spintax::parse('Schrödinger’s Cat is {dead|alive}.');
$string = $spintax->generate();
```

### Get all possible spins:

[](#get-all-possible-spins)

```
use MadeITBelgium\Spintax\SpintaxFacade as Spintax;

Spintax::parse('Your {text|content} here.')->getAll();
```

```
use MadeITBelgium\Spintax\SpintaxFacade as Spintax;

$spintax = Spintax::parse('Schrödinger’s Cat is {dead|alive}.');
$strings = $spintax->getAll();
```

### Other examples

[](#other-examples)

But there is much more that than that in our library. First of all nested structures are supported:

```
use MadeITBelgium\Spintax\SpintaxFacade as Spintax;

$spintax = Spintax::parse('I {love {PHP|Java|C|C++|JavaScript|Python}|hate Ruby}.');
$string = $spintax->generate();
```

Still not finished! With our brilliant library you can detect the path used to generate given variant and re-use it later:

```
use MadeITBelgium\Spintax\SpintaxFacade as Spintax;

$path = [];

$spintax = Spintax::parse('I {love {PHP|Java|C|C++|JavaScript|Python}|hate Ruby}.');
// since $path is empty, random values will be used for missing indices and $path will be filled with them
$string = $spintax->generate($path);

// from now you can use $path to re-create the same combination
// all these calls will keep returning same string value
$spintax->generate($path);
$spintax->generate($path);
$spintax->generate($path);
$spintax->generate($path);

// this will force generating "I love Java."
$path = [0, 1];
$spintax->generate($path);
```

Paths are counted from 0, each entry is next step.

You can also use partial paths to define just the starting path and all missing parts will be choosen randomly:

```
use MadeITBelgium\Spintax\SpintaxFacade as Spintax;

$path = [0];

$spintax = Spintax::parse('I {love {PHP|Java|C|C++|JavaScript|Python}|hate Ruby}.');
// this will generate one of "I love {}." variants
$string = $spintax->generate($path);
```

For all this there is a shortcut method `Parser::replicate()` (you can use comma-separated number in a single string as second argument in this shortcut method):

```
use MadeITBelgium\Spintax\SpintaxFacade as Spintax;

echo Spintax::replicate('I {love {PHP|Java|C|C++|JavaScript|Python}|hate Ruby}.', '0,0');
```

The complete documentation can be found at:

Support
=======

[](#support)

Support github or mail:

Contributing
============

[](#contributing)

Please try to follow the psr-2 coding style guide.

License
=======

[](#license)

This package is licensed under LGPL. You are free to use it in personal and commercial projects. The code can be forked and modified, but the original copyright author should always be included!

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~255 days

Recently: every ~228 days

Total

6

Last Release

1390d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e3d01bc996f789c6362a12e51af7b19ad39ca580f77dc6ef4ff1754888391508?d=identicon)[MadeITBelgium](/maintainers/MadeITBelgium)

---

Top Contributors

[![madeITBelgium](https://avatars.githubusercontent.com/u/20304892?v=4)](https://github.com/madeITBelgium "madeITBelgium (24 commits)")

---

Tags

laravelcontentseobulkOnPagecopywriting

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/madeitbelgium-spintax/health.svg)

```
[![Health](https://phpackages.com/badges/madeitbelgium-spintax/health.svg)](https://phpackages.com/packages/madeitbelgium-spintax)
```

###  Alternatives

[fomvasss/laravel-meta-tags

A package to manage SEO (meta-tags, xml-fields, etc.)

3028.9k](/packages/fomvasss-laravel-meta-tags)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
