Files
City10/app/Models/MarketListing.php
marcocosta10000 c299a4ae21 feat(city): implement marketplace, missions, customization and admin dashboard
- Add database migrations for market_listings, missions and character cosmetics
- Create controllers for marketplace, missions, presence and character customization
- Implement admin world dashboard with live platform metrics
- Add feature tests for world functionality
- Include phase 2 design documents and gap analysis
2026-10-17 23:21:23 -03:00

49 lines
1.0 KiB
PHP
Executable File

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* Player-to-player marketplace listing.
*/
#[Fillable(['seller_character_id', 'city_id', 'item', 'qty', 'unit_price', 'is_active'])]
class MarketListing extends Model
{
/**
* Listing seller.
*
* @return BelongsTo<Character, $this>
*/
public function seller(): BelongsTo
{
return $this->belongsTo(Character::class, 'seller_character_id');
}
/**
* City where the listing is visible.
*
* @return BelongsTo<City, $this>
*/
public function city(): BelongsTo
{
return $this->belongsTo(City::class);
}
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'unit_price' => 'float',
'qty' => 'integer',
'is_active' => 'boolean',
];
}
}