hapheus / laravel-text-spinner
A Laravel package to spin text.
dev-master
2022-02-11 06:02 UTC
Requires
- illuminate/support: ^5|^6|^7|^8|^9
Requires (Dev)
- phpunit/phpunit: ^9.1
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2024-08-11 11:10:17 UTC
README
Install
Using composer
composer require hapheus/laravel-text-spinner
Features
Spin's a set of nested strings into plain text.
Example: "Foo{Bar|Foo}"
returns "FooBar"
or "FooFoo"
.
Usage
1. Using Class
$text = '{Ehlo|Hello|Howdy} {World|Earth|You}{!|?|.}';
$textSpinner = new HAF\TextSpinner\TextSpinner();
$spinnedText = $textSpinner->spin();
2. Using Laravel Facade
$text = '{Ehlo|Hello|Howdy} {World|Earth|You}{!|?|.}';
$spinnedText = app('text-spinner')->spin($text);
$spinnedText = App::make('text-spinner')->spin($text);
$spinnedText = TextSpinner::spin($text);
Code Quality
composer test
composer check-style