*/ public function characters(): BelongsToMany { return $this->belongsToMany(Character::class, 'character_missions') ->withPivot(['progress', 'is_completed', 'completed_at']) ->withTimestamps(); } /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'reward' => 'float', 'target' => 'integer', 'is_active' => 'boolean', ]; } }