Path: blob/1.0-develop/app/Providers/HashidsServiceProvider.php
7432 views
<?php12namespace Pterodactyl\Providers;34use Pterodactyl\Extensions\Hashids;5use Illuminate\Support\ServiceProvider;6use Pterodactyl\Contracts\Extensions\HashidsInterface;78class HashidsServiceProvider extends ServiceProvider9{10/**11* Register the ability to use Hashids.12*/13public function register(): void14{15$this->app->singleton(HashidsInterface::class, function () {16/** @var \Illuminate\Contracts\Config\Repository $config */17$config = $this->app['config'];1819return new Hashids(20$config->get('hashids.salt', ''),21$config->get('hashids.length', 0),22$config->get('hashids.alphabet', 'abcdefghijkmlnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890')23);24});2526$this->app->alias(HashidsInterface::class, 'hashids');27}28}293031