PHP code example of pfrug / clear-logs
1. Go to this page and download the library: Download pfrug/clear-logs 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/ */
pfrug / clear-logs example snippets
return [
// Number of days to preserve (default: 7)
'days' => 7,
// Mode used to determine the file date for daily logs
// Options: 'name' or 'mtime'
'evalDateByNameOrMTime' => 'name',
];
protected function schedule(Schedule $schedule): void
{
// Run daily at 2 AM
$schedule->command('log:clear')->dailyAt('02:00');
}
sh
php artisan vendor:publish --provider="Pfrug\ClearLogs\ClearLogsServiceProvider" --tag="clear-logs-config"