darwinnatha/purge-logs

a simple package for deleting logs by keeping those at a given period

v1.0 2024-10-07 03:00 UTC

This package is auto-updated.

Last update: 2025-06-07 17:49:07 UTC


README

Latest Version on Packagist Total Downloads

This package allows you to delete logs, keeping only those from a given period.

Installation

To install this package, you should add the package to your project via Composer.

composer require darwinnatha/pure-logs

Usage

To use this package, publish the configuration file.

php artisan vendor:publish --provider="Darwinnatha\PurgeLogs\PurgeLogsServiceProvider"

Then, you can purge the logs by running the following command.

php artisan logs:purge

Alternatively, if you want to specify the number of days to retain, you can use the keep-days argument.

php artisan logs:purge --keep-days=7

Configuration

You can configure the number of days to retain by editing the config/purge-logs.php file.

return [
    'retention_period' => 7,
];