Added achievement data

This commit is contained in:
2026-04-26 15:16:17 +10:00
parent 1821b99524
commit f6d5b97784
6 changed files with 1022 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* @property int $id
* @property int $user_id
* @property int $achievement_id
* @property int|null $progress
*
* @property-read User $user
* @property-read Achievement $achievement
*/
class UserAchievement extends Model
{
protected $fillable = [
'user_id',
'achievement_id',
'progress',
];
protected $casts = [
'progress' => 'integer',
];
// ---------------------------------------------------------------
// Relationships
// ---------------------------------------------------------------
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function achievement(): BelongsTo
{
return $this->belongsTo(Achievement::class);
}
}