🚀 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
$

📄 EventServiceProvider.php

📁 Path: /home/skhata/new.chandrapharma.com/app/Providers/EventServiceProvider.php
📊 Size: 2.1 KB
🔒 Perm: 0600
📝 MIME: text/x-php
<?php

namespace App\Providers;

use App\Modules\Order\Events\OrderPlaced;
use App\Modules\Order\Events\OrderStatusChanged;
use App\Modules\Order\Listeners\SendOrderNotificationEmail;
use App\Modules\Order\Listeners\SendOrderPlacedEmail;
use App\Modules\Pharmacy\Events\PrescriptionStatusChanged;
use App\Modules\Pharmacy\Listeners\SendPrescriptionStatusEmail;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;

class EventServiceProvider extends ServiceProvider
{
    /**
     * Event → Listener mappings.
     */
    protected $listen = [
        // AuthService::register() fires Registered on every new signup, but
        // shouldDiscoverEvents() below is false (auto-discovery off) and
        // this custom $listen array never carried Laravel's standard
        // Registered -> SendEmailVerificationNotification mapping — the one
        // that normally ships in a fresh app's EventServiceProvider. Net
        // effect: the Registered event fired every time, nothing was
        // listening, and no verification email was ever sent on signup.
        // Users only got an email if they explicitly clicked "Resend".
        Registered::class => [
            SendEmailVerificationNotification::class,
        ],

        // Fired immediately when a new order is created (status = pending)
        OrderPlaced::class => [
            SendOrderPlacedEmail::class,
        ],

        // Fired on every status transition (confirmed, shipped, delivered, cancelled, refunded)
        OrderStatusChanged::class => [
            SendOrderNotificationEmail::class,
        ],

        // Fired when a pharmacist approves or rejects a prescription
        PrescriptionStatusChanged::class => [
            SendPrescriptionStatusEmail::class,
        ],
    ];

    public function boot(): void
    {
        parent::boot();
    }

    /**
     * Determine if events and listeners should be auto-discovered.
     */
    public function shouldDiscoverEvents(): bool
    {
        return false;
    }
}
← Back📥 Raw✏️ Edit🔒 Chmod
✨ File Manager Magic ✨