You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Malio/app/Services/Factory.php

25 lines
493 B
PHP

<?php
namespace App\Services;
use App\Services\Auth\Cookie;
use App\Services\Auth\Redis;
use App\Services\Auth\JwtToken;
class Factory
{
public static function createAuth()
{
$method = Config::get('authDriver');
switch ($method) {
case 'cookie':
return new Cookie();
case 'redis':
return new Redis();
case 'jwt':
return new JwtToken();
}
return new Redis();
}
}