jbrooksuk / laravel-colorize

A handy set of Stringable mixins for CLI text.

Home Page:https://james.brooks.page

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Laravel Colorize

A mixin for Laravel's Stringable to easily apply colors and styles to CLI text.

Latest Version on Packagist Test Total Downloads

Installation

You can install the package via Composer:

composer require jbrooksuk/laravel-colorize

Usage

blink

Make the text blink.

Str::of('Hey Laravel')->blink();

bold

Make the text bold.

Str::of('Hey Laravel')->bold();

colorize

Colorize the text. Foreground, Background.

Str::of('Hey Laravel')->colorize('red', 'blue');

conceal

Make the text invisible.

Str::of('Hey Laravel')->conceal();

reverse

Swap the foreground with the background and the background with the foreground.

Str::of('Hey Laravel')->colorize('red', 'blue')->reverse();

underscore

Make the text underscored.

Str::of('Hey Laravel')->underscore();

Chaining

Because Laravel Colorize uses Stringable, all of these methods can be chained together.

Str::of('Hey Laravel')->colorize('red', 'yellow')->bold()->blink();

About

A handy set of Stringable mixins for CLI text.

https://james.brooks.page

License:MIT License


Languages

Language:PHP 100.0%