*/ public function fromCharacter(): BelongsTo { return $this->belongsTo(Character::class, 'from_character_id'); } /** * Character that received payment or items. * * @return BelongsTo */ public function toCharacter(): BelongsTo { return $this->belongsTo(Character::class, 'to_character_id'); } /** * Store involved in the exchange, when any. * * @return BelongsTo */ public function store(): BelongsTo { return $this->belongsTo(Store::class); } /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'amount' => 'float', 'qty' => 'integer', ]; } }