Search code examples
phplaravellaravel-artisan

Hide output of php artisan serve


When I run php artisan serve I always get logs in the console like

[Sat Jan 22 07:16:29 2022] 127.0.0.1:48232 Closing
[Sat Jan 22 07:16:29 2022] 127.0.0.1:48240 Accepted
[Sat Jan 22 07:16:29 2022] 127.0.0.1:48236 Closing
[Sat Jan 22 07:16:29 2022] 127.0.0.1:48244 Accepted

I've tried php artisan serve -q but it's not working.

Is there a way to disable them?


Solution

  • i think this is a bug and if you going to use laravel 8 , this bug will be fix!

    anyway. if you are on linux, you can run command like this:

    php artisan serve -q > /dev/null 2>&l
    

    and if you are on windows, you can run command like this:

    php artisan serve -q 1>NUL 2>NUL
    

    this syntax will redirect all outputs (stdout, stderr) to /dev/null. you can run any command silently with this syntax.