Files
City10/app/Models/Mission.php
T
marcocosta10000 a620f83dd8 feat(city): add player marketplace, mission journal, character customization and presence
- Player-to-player marketplace with listings, buying and selling
- Mission system with progress tracking and money rewards
- Character appearance customization (skin, hair, face, beard, accessory)
- Multiplayer presence feed showing nearby citizens in near-real-time
- Admin world dashboard with live platform metrics
- Bus and train transportation with temporary ride state
- Mobile joystick controls and minimap HUD
- Education bonus applied to work salary
2026-10-17 22:51:20 -03:00

41 lines
1.0 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
/**
* Catalog mission that citizens can complete for a reward.
*/
#[Fillable(['city_id', 'code', 'title', 'description', 'metric', 'target', 'reward', 'is_active'])]
class Mission extends Model
{
/**
* Characters tracking this mission.
*
* @return BelongsToMany<Character, $this>
*/
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<string, string>
*/
protected function casts(): array
{
return [
'reward' => 'float',
'target' => 'integer',
'is_active' => 'boolean',
];
}
}