https://github.com/jbrooksuk/laravel-colorize
A handy set of Stringable mixins for CLI text.
https://github.com/jbrooksuk/laravel-colorize
Last synced: 2 months ago
JSON representation
A handy set of Stringable mixins for CLI text.
- Host: GitHub
- URL: https://github.com/jbrooksuk/laravel-colorize
- Owner: jbrooksuk
- License: mit
- Created: 2021-05-21T21:51:48.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-24T15:04:30.000Z (about 4 years ago)
- Last Synced: 2025-03-30T16:11:32.334Z (3 months ago)
- Language: PHP
- Homepage: https://james.brooks.page
- Size: 12.7 KB
- Stars: 47
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# Laravel Colorize
A mixin for Laravel's `Stringable` to easily apply colors and styles to CLI text.
[](https://packagist.org/packages/jbrooksuk/laravel-colorize)

[](https://packagist.org/packages/jbrooksuk/laravel-colorize)## Installation
You can install the package via Composer:
```
composer require jbrooksuk/laravel-colorize
```## Usage
### `blink`
Make the text blink.
```php
Str::of('Hey Laravel')->blink();
```### `bold`
Make the text bold.
```php
Str::of('Hey Laravel')->bold();
```### `colorize`
Colorize the text. Foreground, Background.
```php
Str::of('Hey Laravel')->colorize('red', 'blue');
```### `conceal`
Make the text invisible.
```php
Str::of('Hey Laravel')->conceal();
```### `reverse`
Swap the foreground with the background and the background with the foreground.
```php
Str::of('Hey Laravel')->colorize('red', 'blue')->reverse();
```### `underscore`
Make the text underscored.
```php
Str::of('Hey Laravel')->underscore();
```## Chaining
Because Laravel Colorize uses `Stringable`, all of these methods can be chained together.
```php
Str::of('Hey Laravel')->colorize('red', 'yellow')->bold()->blink();
```