This commit is contained in:
2026-03-20 21:17:26 +01:00
parent 1a62fcb81d
commit 29c3ff8572
229 changed files with 13147 additions and 2577 deletions

View File

@@ -0,0 +1,42 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use App\Models\Achievement;
class UserAchievement extends Model
{
use HasFactory;
public $timestamps = false;
protected $fillable = [
'user_id',
'achievement_id',
'unlocked_at',
];
protected function casts(): array
{
return [
'user_id' => 'integer',
'achievement_id' => 'integer',
'unlocked_at' => 'datetime',
];
}
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function achievement(): BelongsTo
{
return $this->belongsTo(Achievement::class, 'achievement_id');
}
}