Files
2026-05-09 17:32:17 +02:00

31 lines
628 B
PHP
Executable File

<?php
namespace App\Models;
use App\Models\Compositions\HasBadge;
use Illuminate\Database\Eloquent\Model;
/**
* @property int $id
* @property string $name
* @property int $level
*/
class Achievement extends Model implements HasBadge
{
#[\Override]
public $timestamps = false;
#[\Override]
protected $guarded = ['id', 'name', 'level'];
public function getBadgePath(): string
{
return sprintf('%sACH_%s.gif', setting('badges_path'), $this->getBadgeName());
}
public function getBadgeName(): string
{
return sprintf('%s%s', $this->name, (string) $this->level);
}
}