Answers for "how to clear logs in laravel"

PHP
2

clear log file laravel command

truncate -s 0 storage/logs/laravel.log
Posted by: Guest on May-28-2020
0

clear laravel.log

//routes/console.php

Artisan::command('logs:clear', function() {

    exec('rm ' . storage_path('logs/*.log'));

    $this->comment('Logs have been cleared!');

})->describe('Clear log files');


//php artisan logs:clear
Posted by: Guest on February-19-2021

Browse Popular Code Answers by Language