34 lines
800 B
PHP
34 lines
800 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
/**
|
|
* @property int $id
|
|
* @property string $internal_name
|
|
* @property string $name
|
|
* @property string $description
|
|
*
|
|
* @property-read Collection<int, Achievement> $achievements
|
|
*/
|
|
class AchievementCategory extends Model
|
|
{
|
|
protected $fillable = [
|
|
'internal_name',
|
|
'name',
|
|
'description',
|
|
];
|
|
|
|
// ---------------------------------------------------------------
|
|
// Relationships
|
|
// ---------------------------------------------------------------
|
|
|
|
public function achievements(): HasMany
|
|
{
|
|
return $this->hasMany(Achievement::class, 'achievement_category_id');
|
|
}
|
|
}
|