You've already forked Atomcms-edit
Initial commit
This commit is contained in:
Executable
+30
@@ -0,0 +1,30 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user