game-village-politics-backend/app/Models/LevelReward.php

31 lines
678 B
PHP
Raw Permalink Normal View History

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/** Part of a building level's cost, paid back the first time a player reaches that level. */
class LevelReward extends Model
{
public $timestamps = false;
protected $guarded = [];
protected $dateFormat = 'Y-m-d H:i:s.v';
protected function casts(): array
{
return [
'reward' => 'array',
'reached_at' => 'immutable_datetime',
'claimed_at' => 'immutable_datetime',
];
}
public function village(): BelongsTo
{
return $this->belongsTo(Village::class);
}
}