Files
pterodactyl-panel/app/Extensions/Hashids.php
T

20 lines
457 B
PHP
Raw Normal View History

2017-09-09 23:55:21 -05:00
<?php
2026-10-05 18:10:18 -04:00
declare(strict_types=1);
2017-09-09 23:55:21 -05:00
namespace Pterodactyl\Extensions;
use Hashids\Hashids as VendorHashids;
2026-10-05 18:10:18 -04:00
use Illuminate\Support\Arr;
2017-09-09 23:55:21 -05:00
use Pterodactyl\Contracts\Extensions\HashidsInterface;
class Hashids extends VendorHashids implements HashidsInterface
{
2026-10-05 18:10:18 -04:00
public function decodeFirst(string $encoded, ?string $default = null): int|string|null
2017-09-09 23:55:21 -05:00
{
$result = $this->decode($encoded);
return Arr::first($result, null, $default);
2017-09-09 23:55:21 -05:00
}
}