2017-09-10 06:55:21 +02:00
|
|
|
<?php
|
2017-09-26 04:43:01 +02:00
|
|
|
/**
|
2017-09-10 06:55:21 +02:00
|
|
|
* Pterodactyl - Panel
|
|
|
|
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
|
|
|
*
|
2017-09-26 04:43:01 +02:00
|
|
|
* This software is licensed under the terms of the MIT license.
|
|
|
|
* https://opensource.org/licenses/MIT
|
2017-09-10 06:55:21 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Pterodactyl\Providers;
|
|
|
|
|
|
|
|
use Pterodactyl\Extensions\Hashids;
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
use Pterodactyl\Contracts\Extensions\HashidsInterface;
|
|
|
|
|
|
|
|
class HashidsServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Register the ability to use Hashids.
|
|
|
|
*/
|
|
|
|
public function register()
|
|
|
|
{
|
|
|
|
$this->app->singleton(HashidsInterface::class, function () {
|
|
|
|
/** @var \Illuminate\Contracts\Config\Repository $config */
|
|
|
|
$config = $this->app['config'];
|
|
|
|
|
|
|
|
return new Hashids(
|
|
|
|
$config->get('hashids.salt', ''),
|
|
|
|
$config->get('hashids.length', 0),
|
2018-05-13 16:50:56 +02:00
|
|
|
$config->get('hashids.alphabet', 'abcdefghijkmlnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890')
|
2017-09-10 06:55:21 +02:00
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
$this->app->alias(HashidsInterface::class, 'hashids');
|
|
|
|
}
|
|
|
|
}
|