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/PasswordBrokerManager.php
<?php declare(strict_types=1);


namespace Komma\KMS\Auth;

use \Illuminate\Auth\Passwords\PasswordBrokerManager as LaravelPasswordBrokerManager;

/**
 * Class PasswordBrokerManager
 *
 * @mixin PasswordBroker
 *
 * @package Komma\KMS\Auth
 */
class PasswordBrokerManager extends LaravelPasswordBrokerManager
{
    /**
     * Resolve the given broker.
     * Overwrite existing method to return our custom PasswordBroker class.
     *
     * @param  string  $name
     * @return PasswordBroker
     *
     * @throws \InvalidArgumentException
     */
    protected function resolve($name)
    {
        $config = $this->getConfig($name);

        if (is_null($config)) {
            throw new \InvalidArgumentException("Password resetter [{$name}] is not defined.");
        }

        // The password broker uses a token repository to validate tokens and send user
        // password e-mails, as well as validating that password reset process as an
        // aggregate service of sorts providing a convenient interface for resets.
        return new PasswordBroker(
            $this->createTokenRepository($config),
            $this->app['auth']->createUserProvider($config['provider'] ?? null)
        );
    }
}