Skip to content

Instantly share code, notes, and snippets.

@emmanuelbarturen
Created September 16, 2017 16:02
Show Gist options
  • Save emmanuelbarturen/e51fe32965ae1280e2691b2dfdfe8831 to your computer and use it in GitHub Desktop.
Save emmanuelbarturen/e51fe32965ae1280e2691b2dfdfe8831 to your computer and use it in GitHub Desktop.
Laravel 5.* Change output color in terminal.
/*
|--------------------------------------------------------------------------
| Run The Artisan Application
|--------------------------------------------------------------------------
|
| When we run the console application, the current CLI command will be
| executed in this console and the response sent back to a terminal
| or another output device for the developers. Here goes nothing!
|
*/
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
/*Available colors
* black,red,green,yellow,blue,magenta,cyan,white,default
* */
$output = new Symfony\Component\Console\Output\ConsoleOutput;
$output->getFormatter()->setStyle('error', new \Symfony\Component\Console\Formatter\OutputFormatterStyle('black', 'red'));
$status = $kernel->handle(
$input = new Symfony\Component\Console\Input\ArgvInput,
$output
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment