1
0
forked from metin2/web
web/app/Providers/AuthServiceProvider.php

33 lines
827 B
PHP
Raw Normal View History

2023-07-23 01:14:14 +03:00
<?php
namespace App\Providers;
2023-07-28 19:57:16 +03:00
use App\Hashing\MySQLHasher;
use Illuminate\Auth\EloquentUserProvider;
use Illuminate\Foundation\Application;
2023-07-23 01:14:14 +03:00
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
2023-07-28 19:57:16 +03:00
use Illuminate\Support\Facades\Auth;
2023-07-23 01:14:14 +03:00
class AuthServiceProvider extends ServiceProvider
{
/**
* The model to policy mappings for the application.
*
* @var array<class-string, class-string>
*/
protected $policies = [
//
];
/**
* Register any authentication / authorization services.
*/
public function boot(): void
{
2023-07-28 19:57:16 +03:00
Auth::provider('legacy', function (Application $app, array $config) {
$mysqlHasher = new MySQLHasher();
return new EloquentUserProvider($mysqlHasher, $config['model']);
});
2023-07-23 01:14:14 +03:00
}
}