clear log file laravel code example
Example 1: clear log file laravel command
truncate -s 0 storage/logs/laravel.log
Example 2: 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