🚀 Hostinger Optimized
🖥️ Server: LiteSpeed
💻 System: Linux s20058.bom1.stableserver.net 5.14.0-611.55.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 15:19:29 EDT 2026 x86_64
👤 User: skhata (1324)
🐘 PHP: 8.4.20
🚫 Disabled: ✨ NONE

💻 Terminal

📁 /home/skhata/chandrasons.com/public
$

📄 console.php

📁 Path: //home7/skhata/new.chandrapharma.com/routes/console.php
📊 Size: 2.11 KB
🔒 Perm: 0644
📝 MIME: text/x-php
<?php

use App\Console\Commands\ExpirePrescriptionsCommand;
use App\Console\Commands\PublishScheduledProductsCommand;
use App\Console\Commands\RecoverAbandonedCartsCommand;
use App\Modules\Promotions\Jobs\ExpireLoyaltyPointsJob;
use App\Modules\Payout\Jobs\ProcessScheduledPayoutsJob;
use Illuminate\Support\Facades\Schedule;

/*
|--------------------------------------------------------------------------
| Phase 4 — Console Schedule
|--------------------------------------------------------------------------
| All Phase 4 scheduled tasks are defined here.
| The cPanel cron (Phase 1–3) runs: php artisan schedule:run every minute.
| On VPS (Phase 4): Supervisor/systemd runs: php artisan schedule:work
*/

// Publish products whose scheduled publish_at has passed
Schedule::command(PublishScheduledProductsCommand::class)
    ->everyFiveMinutes()
    ->withoutOverlapping()
    ->runInBackground();

// Abandoned cart recovery — 3h / 24h / 48h sequences
Schedule::command(RecoverAbandonedCartsCommand::class)
    ->everyThirtyMinutes()
    ->withoutOverlapping()
    ->runInBackground();

// Expire loyalty points daily at midnight
Schedule::job(new ExpireLoyaltyPointsJob)
    ->dailyAt('00:05')
    ->withoutOverlapping();

// Process vendor payouts daily at 8 AM
Schedule::job(new ProcessScheduledPayoutsJob)
    ->dailyAt('08:00')
    ->withoutOverlapping();

// Clean up expired gift cards (mark as expired) — daily
Schedule::call(function () {
    \App\Modules\Promotions\Models\GiftCard::where('status', 'active')
        ->where('expires_at', '<', now())
        ->update(['status' => 'expired']);
})->daily()->name('expire-gift-cards')->withoutOverlapping();

// Pharmacy: expire approved prescriptions whose valid_until has passed
Schedule::command(ExpirePrescriptionsCommand::class)
    ->dailyAt('01:00')
    ->withoutOverlapping()
    ->runInBackground();

// Queue health check — hourly (logs queue size)
Schedule::call(function () {
    $pending = \Illuminate\Support\Facades\DB::table('jobs')->count();
    \Illuminate\Support\Facades\Log::info("Queue depth: {$pending} jobs pending");
})->hourly()->name('queue-health-check');
← Back📥 Raw✏️ Edit🔒 Chmod
✨ File Manager Magic ✨