- 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
49 lines
1.0 KiB
PHP
49 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\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',
|
|
];
|
|
}
|
|
}
|