mirror of
https://github.com/pterodactyl/panel.git
synced 2026-11-30 19:36:02 -05:00
20 lines
368 B
PHP
20 lines
368 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Pterodactyl\Models\Traits;
|
|
|
|
use Illuminate\Database\Eloquent\Casts\Attribute;
|
|
use Pterodactyl\Facades\Hashids;
|
|
|
|
trait HasHashid
|
|
{
|
|
/**
|
|
* @return Attribute<string, never>
|
|
*/
|
|
protected function hashid(): Attribute
|
|
{
|
|
return Attribute::get(fn (): string => Hashids::encode($this->getKey()));
|
|
}
|
|
}
|