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/base.komma.pro/vendor/komma/kms/src/Auth/AuthMailService.php
<?php


namespace Komma\KMS\Auth;

use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Support\Facades\Password;
use Komma\KMS\Notifications\KmsResetPasswordNotification;
use Komma\KMS\Notifications\KmsSetPasswordNotification;

/**
 * Class AuthMailService
 *
 * A service responsible for sending mails about authorisation and authentication.
 *
 * @package App\Auth
 */
class AuthMailService implements AuthMailServiceInterface
{
    /**
     * Notify user that he needs to set a password to login
     *
     * @param Authenticatable $newUser
     * @return null
     */
    public function notifyUserToSetPassword(Authenticatable $newUser)
    {
        $token = Password::getRepository()->create($newUser);
        $newUser->notify(new KmsSetPasswordNotification($newUser, $token));
        return null;
    }

    /**
     * Notify user that he needs to set a password to login
     *
     * @param Authenticatable $newUser
     * @return null
     */
    public function notifyUserToResetPassword(Authenticatable $newUser)
    {
        $token = Password::getRepository()->create($newUser);
        $newUser->notify(new KmsResetPasswordNotification($newUser, $token));
        return null;
    }
}