Files
postshop-backend/app/Console/Kernel.php
2026-02-03 15:31:29 +05:00

33 lines
805 B
PHP

<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Laravel\Nova\Fields\Attachments\PruneStaleAttachments;
class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*/
protected function schedule(Schedule $schedule): void
{
// Remove unnecessary documents...
$schedule->exec('rm -rf '.public_path('app-docs/*'))->everyMinute();
// Remove non saved attachments...
$schedule->call(new PruneStaleAttachments)->daily();
}
/**
* Register the commands for the application.
*/
protected function commands(): void
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}