31 lines
703 B
PHP
31 lines
703 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
/**
|
|
* An open offer at a village's market: count times give_amount of one resource for
|
|
* want_amount of another. The resources and merchants for the open count are reserved.
|
|
*/
|
|
class TradeOffer extends Model
|
|
{
|
|
protected $guarded = [];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'give_amount' => 'integer',
|
|
'want_amount' => 'integer',
|
|
'count' => 'integer',
|
|
'merchants' => 'integer',
|
|
];
|
|
}
|
|
|
|
public function village(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Village::class);
|
|
}
|
|
}
|