Files
City10/app/Models/InventoryItem.php
marcocosta10000 79ce2a1825 feat(world): add persistent citizen simulation with needs, jobs, and social features
- Adds Character model with survival needs (hunger, thirst, energy) and state machine
- Implements city:tick world ticker for offline progression every minute
- Adds city territory expansion and building construction system
- Introduces job economy, inventory, and transaction audit trail
- Adds social graph (friends, marriage, children) and character chat
- Implements admin approval workflow for new registrations
- Adds hospital admission system for traffic accidents
- Includes comprehensive feature tests and world seeders
2026-10-17 21:46:23 -03:00

33 lines
686 B
PHP
Executable File

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* Stackable inventory row owned by a character.
*/
#[Fillable(['character_id', 'item', 'qty'])]
class InventoryItem extends Model
{
public const ITEM_FOOD = 'food';
public const ITEM_WATER = 'water';
public const ITEM_MATERIALS = 'materials';
public const ITEM_PRODUCT = 'product';
/**
* Owning character.
*
* @return BelongsTo<Character, $this>
*/
public function character(): BelongsTo
{
return $this->belongsTo(Character::class);
}
}