Level 47
Try using double quotes around the newline.
$this->info(' Done. ' . "\n");
9 likes
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi,
I would like to out put a new line on the console to give the user an update on the setup progress. I tried \n but that didn't work. Here is what I have:
$this->info(' Setting up database migrations .... .');
$main = $this->output->createProgressBar(100);
$this->call('migrate:install');
$this->call('migrate:refresh');
$this->call('start:data');
$this->call('roles:make');
$main->finish();
$this->info(' Done.');
// output
100/100 [============================] 100% Application data has been generated.
100/100 [============================] 100% Roles Has been created.
100/100 [============================] 100% Done.
I prefer the output to be
100/100 [============================] 100%
Application data has been generated.
100/100 [============================] 100%
Roles Has been created.
100/100 [============================] 100%
Done.
P.S
right now I can do the below to output a newline. I am looking for something like $this->info(' Done. \n' );
$this->info('');
$this->info(' Done.');
Please or to participate in this conversation.