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;
}
}