PHP code example of mifesta / laravel-log-cleaner
1. Go to this page and download the library: Download mifesta/laravel-log-cleaner library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mifesta / laravel-log-cleaner example snippets
use Mifesta\LogCleaner\Facades\Cleaner;
Cleaner::rotate(14);
if (Cleaner::dir(storage_path('logs'))->clear()) {
// Entries older than 14 days were removed.
}
shell
php artisan log:clear
shell
php artisan log:clear --rotate=14