You've already forked Atomcms-edit
31 lines
628 B
PHP
Executable File
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);
|
|
}
|
|
}
|