2015-12-06 18:58:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Providers;
|
|
|
|
|
2022-05-22 18:57:06 +00:00
|
|
|
use Laravel\Sanctum\Sanctum;
|
|
|
|
use Pterodactyl\Models\Server;
|
|
|
|
use Pterodactyl\Models\ApiKey;
|
|
|
|
use Pterodactyl\Policies\ServerPolicy;
|
2015-12-06 18:58:49 +00:00
|
|
|
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
|
|
|
|
|
|
|
class AuthServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The policy mappings for the application.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $policies = [
|
2022-05-22 18:57:06 +00:00
|
|
|
Server::class => ServerPolicy::class,
|
2015-12-06 18:58:49 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register any application authentication / authorization services.
|
|
|
|
*/
|
2017-04-01 21:59:43 +00:00
|
|
|
public function boot()
|
2015-12-06 18:58:49 +00:00
|
|
|
{
|
2022-05-22 18:57:06 +00:00
|
|
|
Sanctum::usePersonalAccessTokenModel(ApiKey::class);
|
|
|
|
|
2017-04-01 21:59:43 +00:00
|
|
|
$this->registerPolicies();
|
2015-12-06 18:58:49 +00:00
|
|
|
}
|
|
|
|
}
|