2024-07-04 00:45:55 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Actions;
|
|
|
|
|
|
|
|
use DB;
|
|
|
|
use Illuminate\Support\Facades\Artisan;
|
|
|
|
use Illuminate\Support\Facades\Http;
|
|
|
|
use Laravel\Telescope\Console\PruneCommand;
|
|
|
|
use Lorisleiva\Actions\Concerns\AsAction;
|
|
|
|
|
|
|
|
class DbMaintainAction
|
|
|
|
{
|
|
|
|
use AsAction;
|
|
|
|
|
|
|
|
public string $commandSignature = 'db:maintain';
|
|
|
|
|
2024-07-04 01:40:43 +02:00
|
|
|
public function handle(): void
|
2024-07-04 00:45:55 +02:00
|
|
|
{
|
|
|
|
Artisan::call(PruneCommand::class, ['--hours' => 168]); // 168h = 7 Tage
|
|
|
|
DB::select('optimize table telescope_entries');
|
2024-07-13 14:08:42 +02:00
|
|
|
Http::post('https://zoomyboy.de/maintain', ['url' => url()->current()]);
|
2024-07-04 00:45:55 +02:00
|
|
|
}
|
|
|
|
}
|