Laravel - Artisan Console - Writing Output

To send output to the console, you may use the line, info, comment, question, warn, and error methods. Each of these methods will use appropriate ANSI colors for their purpose. For example, let's display some general information to the user. Typically, the info method will display in the console as green colored text:

    
    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        // ...
    
        $this->info('The command was successful!');
    }
	

To display an error message, use the error method. Error message text is typically displayed in red:

    
    $this->error('Something went wrong!');
	

You may use the line method to display plain, uncolored text:

    
    $this->line('Display this on the screen');
	

You may use the newLine method to display a blank line:

    
    // Write a single blank line...
    $this->newLine();
    
    // Write three blank lines...
    $this->newLine(3);