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

0 votes

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 (which runs PHP's built-in development web server under the hood):

php artisan serve

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

Aug 11 in Laravel by kartik
• 27,140 points
46 views

1 answer to this question.

0 votes

Hello @kartik,

This can be done with the following PHP function:

error_log('Some message here.');

Hope this is helpfull!!
Thank You!

answered Aug 11 by Niroj
• 58,500 points

Related Questions In Laravel

0 votes
1 answer

How do you get the path to the Laravel Storage folder?

Hello @kartik, In Laravel 3, call path('storage'). In Laravel 4, ...READ MORE

answered Sep 11 in Laravel by Niroj
• 58,500 points
16 views
0 votes
0 answers

How do I access to a variable inside a function?

I mean,I have public class MyClass{ ...READ MORE

5 days ago in Laravel by aakash
• 210 points

edited 5 days ago by Niroj 35 views
0 votes
1 answer

How to call a controller function inside a view in laravel 5

Hello @kartik, Just try this in your view ...READ MORE

answered 1 day ago in Laravel by Niroj
• 58,500 points
6 views
0 votes
1 answer

How to make a new page with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18 in Laravel by Niroj
• 58,500 points
144 views
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18 in Laravel by Niroj
• 58,500 points
2,169 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18 in Laravel by Niroj
• 58,500 points
236 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23 in Laravel by Niroj
• 58,500 points
189 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23 in Laravel by Niroj
• 58,500 points
2,683 views
0 votes
1 answer

How Can I Set the Default Value of a Timestamp Column to the Current Timestamp with Laravel Migrations?

Hello, To create both of the created_at and updated_at columns: $t->timestamp('created_at')->default(DB::raw('CURRENT_TIMESTAMP')); $t->timestamp('updated_at')->default(DB::raw('CURRENT_TIMESTAMP on update ...READ MORE

answered Apr 2 in Laravel by Niroj
• 58,500 points
2,109 views
0 votes
1 answer

How do I set up phpMyAdmin on a Laravel Homestead box?

Hello, Step 1: Go to the phpMyAdmin website, download the latest ...READ MORE

answered Mar 31 in Laravel by Niroj
• 58,500 points
693 views