Using composer
composer require hapheus/laravel-text-spinner
Spin's a set of nested strings into plain text.
Example: "Foo{Bar|Foo}"
returns "FooBar"
or "FooFoo"
.
$text = '{Ehlo|Hello|Howdy} {World|Earth|You}{!|?|.}';
$textSpinner = new HAF\TextSpinner\TextSpinner();
$spinnedText = $textSpinner->spin();
$text = '{Ehlo|Hello|Howdy} {World|Earth|You}{!|?|.}';
$spinnedText = app('text-spinner')->spin($text);
$spinnedText = App::make('text-spinner')->spin($text);
$spinnedText = TextSpinner::spin($text);
composer test
composer check-style