2021-08-23 11:05:16 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Modules\Auth\Config;
|
|
|
|
|
2022-10-15 11:22:08 +00:00
|
|
|
use Config\Services as BaseService;
|
|
|
|
use Modules\Auth\Auth;
|
2021-08-23 11:05:16 +00:00
|
|
|
|
|
|
|
class Services extends BaseService
|
|
|
|
{
|
|
|
|
/**
|
2022-10-15 11:22:08 +00:00
|
|
|
* The base auth class
|
2021-08-23 11:05:16 +00:00
|
|
|
*/
|
2022-10-15 11:22:08 +00:00
|
|
|
public static function auth(bool $getShared = true): Auth
|
|
|
|
{
|
2021-08-23 11:05:16 +00:00
|
|
|
if ($getShared) {
|
2023-08-27 13:26:06 +00:00
|
|
|
/** @var Auth */
|
2022-10-15 11:22:08 +00:00
|
|
|
return self::getSharedInstance('auth');
|
2021-08-23 11:05:16 +00:00
|
|
|
}
|
|
|
|
|
2024-04-28 16:39:01 +00:00
|
|
|
$config = config('Auth');
|
2021-08-23 11:05:16 +00:00
|
|
|
|
2023-11-29 16:33:18 +00:00
|
|
|
return new Auth($config);
|
2021-08-23 11:05:16 +00:00
|
|
|
}
|
|
|
|
}
|