31 lines
678 B
PHP
31 lines
678 B
PHP
|
|
<?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);
|
||
|
|
}
|
||
|
|
}
|