HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/csb.komma.pro/app/Auth/Authmailservice.php
<?php declare(strict_types=1);


namespace App\Auth;


use App\Notifications\CustomerRegistered;
use App\Users\Models\SiteUser;
use Komma\KMS\Auth\AuthMailService as KmsAuthMailService;
use Komma\KMS\Users\Models\KmsUser;
use Komma\KMS\Users\Models\KmsUserRole;

class Authmailservice extends KmsAuthMailService
{
    /**
     * Notify admins that a new user has been created
     *
     * @param $customer
     * @return null
     */
    public function notifyAdminsForNewCustomer(SiteUser $customer)
    {
        KmsUser::where('role', '=', KmsUserRole::Admin)->get()->each(function(KmsUser $admin) use ($customer) {
            $admin->notify(new CustomerRegistered($customer));
            \Log::debug('Notified admin with id: '.$admin->id.' that user with id '.$customer->id.' registered');
        });
        return null;
    }
}