mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-21 19:01:37 +00:00
27 lines
553 B
PHP
27 lines
553 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Models\ServerLog;
|
|
use Illuminate\Console\Command;
|
|
use Illuminate\Support\Facades\File;
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
class ClearLogsCommand extends Command
|
|
{
|
|
protected $signature = 'logs:clear';
|
|
|
|
protected $description = 'Clear all server logs';
|
|
|
|
public function handle(): void
|
|
{
|
|
$this->info('Clearing logs...');
|
|
|
|
ServerLog::query()->delete();
|
|
|
|
File::cleanDirectory(Storage::disk('server-logs')->path(''));
|
|
|
|
$this->info('Logs cleared!');
|
|
}
|
|
}
|