Jrop Jrop - 2 months ago 25x
PHP Question

How do I write to the console from a Laravel Controller?

So I have a Laravel controller:

class YeahMyController extends BaseController {
public function getSomething() {
Console::info('mymessage'); // <-- what do I put here?
return 'yeahoutputthistotheresponse';

Currently, I'm running the application using artisan:

php artisan serve

I would like to log console messages to the
pipe for the artisan process.



This can be done with the following PHP function:

error_log('Some message here.');

Found the answer here: Print something in PHP built-in web server