Created
December 20, 2020 17:24
-
-
Save hallindavid/27fd0f361674a9125781c5fb99990635 to your computer and use it in GitHub Desktop.
logs:clear artisan command for Laravel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Artisan::command('logs:clear', function () { | |
exec('rm ' . storage_path('logs/*.log')); | |
$this->comment('Logs have been cleared!'); | |
})->describe('Clear log files'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Blatantly stolen from https://stackoverflow.com/questions/28127495/in-phps-laravel-how-do-i-clear-laravel-log
Drop this in routes/console.php and you're good to do
to clear all your logs