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);
|
|
|
|
|
|
2025-12-20 15:55:13 -08:00
|
|
|
return Arr::first($result, null, $default);
|
2017-09-09 23:55:21 -05:00
|
|
|
}
|
|
|
|
|
}
|