2017 © Pedro Peláez
 

library spinner

A Laravel package to spin content.

image

mikemike/spinner

A Laravel package to spin content.

  • Saturday, April 29, 2017
  • by mikemike
  • Repository
  • 1 Watchers
  • 1 Stars
  • 41 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 11 % Grown

The README.md

Laravel Spinning Package

Introduction

Spin articles and text using this package., (*1)

What is spinning?

Spinning allows an author to write an article or text but provide different variations of words or sentences. This class then plucks a sentence out at random. The idea being that lots of versions of the same article/text will be generated., (*2)

The text format is sometimes referred to as 'spyntax' or 'spintax', (*3)

Example text

{Hello|Hi|Hey} my name is {Frank|Bob|John}, (*4)

may produce: Hi my name is Frank Hey my name is Frank Hello my name is Bob Hi my name is John Hey my name is Bob etc..., (*5)

Installation

Add "mikemike/spinner": "dev-master" to your composer.json., (*6)

Run composer update, (*7)

Add Mikemike\Spinner\SpinnerServiceProvider::class, to the providers array in your config/app.php., (*8)

Add 'Spinner' => Mikemike\Spinner\SpinnerFacade::class, to the aliases array in your config/app.php., (*9)

How to use

Add the class at the top of your class:, (*10)

use Spinner;

And then call it anywhere in your code:, (*11)

$spinner = new Spinner();

$string = '{Hey|Howdy|Hi there|Hi} {there|mate|bud|buddy}, {{how are|how\'re} {you|ya}|how you doin\'|how {you|ya} {feeling|hanging}|you doing {OK|alright}}?';

echo $spinner::process($string);

Notes

Nested spins are supported, as illustrated in the above example., (*12)

Sponsors

This package is sponsored by Accreditly, who offer a number of web development certifications, including:, (*13)

The Versions

29/04 2017

dev-master

9999999-dev

A Laravel package to spin content.

  Sources   Download

MIT

The Requires

 

by Mike Griffiths

laravel spinning spintax spinner spin spyntax