2023-11-17 14:44:01 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
|
|
|
|
use Illuminate\Support\Facades\Gate;
|
|
|
|
|
|
|
|
|
|
class AuthServiceProvider extends ServiceProvider
|
|
|
|
|
{
|
|
|
|
|
/**
|
2025-05-07 19:48:19 +08:00
|
|
|
* 策略映射
|
|
|
|
|
* @var array<class-string, class-string>
|
2023-11-17 14:44:01 +08:00
|
|
|
*/
|
|
|
|
|
protected $policies = [
|
|
|
|
|
// 'App\Model' => 'App\Policies\ModelPolicy',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
/**
|
2025-05-07 19:48:19 +08:00
|
|
|
* 注册任何认证/授权服务
|
2023-11-17 14:44:01 +08:00
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function boot()
|
|
|
|
|
{
|
|
|
|
|
$this->registerPolicies();
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
}
|
|
|
|
|
}
|