2015-12-06 13:58:49 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Providers;
|
|
|
|
|
2022-05-22 14:57:06 -04:00
|
|
|
use Laravel\Sanctum\Sanctum;
|
|
|
|
use Pterodactyl\Models\ApiKey;
|
2022-06-26 16:21:07 -04:00
|
|
|
use Pterodactyl\Models\Server;
|
2022-05-22 14:57:06 -04:00
|
|
|
use Pterodactyl\Policies\ServerPolicy;
|
2015-12-06 13:58:49 -05: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 14:57:06 -04:00
|
|
|
Server::class => ServerPolicy::class,
|
2015-12-06 13:58:49 -05:00
|
|
|
];
|
|
|
|
|
2017-04-01 17:59:43 -04:00
|
|
|
public function boot()
|
2015-12-06 13:58:49 -05:00
|
|
|
{
|
2022-05-22 14:57:06 -04:00
|
|
|
Sanctum::usePersonalAccessTokenModel(ApiKey::class);
|
|
|
|
|
2017-04-01 17:59:43 -04:00
|
|
|
$this->registerPolicies();
|
2015-12-06 13:58:49 -05:00
|
|
|
}
|
2022-05-22 17:01:39 -04:00
|
|
|
|
|
|
|
public function register()
|
|
|
|
{
|
|
|
|
Sanctum::ignoreMigrations();
|
|
|
|
}
|
2015-12-06 13:58:49 -05:00
|
|
|
}
|