How to echo to console in Laravel and Artisan? How to echo to console in Laravel and Artisan? laravel laravel

How to echo to console in Laravel and Artisan?


Don't know if you are using Laravel 3 or Laravel 4, and if its also possible in Laravel 3, but i found this in the docs.

$this->info('Creating sample users...');

EDIT

If you switch to database seeds you can use this to display a message

$this->command->info('Creating sample users...');


This works for me

use Symfony\Component\Console\Output\ConsoleOutput;class MigrateData {    public function up()    {        $output = new ConsoleOutput();        for($i=0; $i<50000; $i++)        {             $output->writeln('Converting '.$i.' of 50000');        }     }}

I have a migration which is converting a large table into a more efficient format and use this to get some progress while it works.


Since the chosen answer doesn't seem to work since 4.2, I say just keep it simple:

public function up() {     // Migration runs //     echo 'Records processed' . PHP_EOL;}