1. Go to this page and download the library: Download alkhatibdev/logrotation 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/ */
Artisan::command('logrotation:rotate', function () {
app('logrotator')->rotate();
})->monthly();
use AlkhatibDev\LogRotation\LogRotator;
$logRotator = new LogRotator();
$logRotator
->setLogFile(storage_path('logs/custom.log')) // Set the log file path to rotate
->rotate();
bash
php artisan vendor:publish --tag=logrotation
bash
php artisan schedule:run
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.