Initial commit

This commit is contained in:
root
2026-05-09 17:28:23 +02:00
commit 9d73f82529
5575 changed files with 281989 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
<?php
namespace App\Models\Game\Furniture;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* @property int $id
* @property string $item_ids
* @property int $page_id
* @property string $catalog_name
* @property int $cost_credits
* @property int $cost_pixels
* @property int $cost_diamonds
* @property int $amount
* @property int $limited_stack
* @property int $limited_sells
* @property int $order_number
* @property string $badge
* @property-read ItemBase|null $itemBase
*
* @method static \Illuminate\Database\Eloquent\Builder<static>|CatalogItem whereKey($id)
* @method static \Illuminate\Database\Eloquent\Builder<static>|CatalogItem where($column, $operator = null, $value = null)
* @method static \Illuminate\Database\Eloquent\Builder<static>|CatalogItem whereIn($column, $values, $boolean = 'and', $not = false)
*/
class CatalogItem extends Model
{
#[\Override]
protected $guarded = ['id', 'created_at', 'updated_at', 'page_id', 'item_ids', 'cost_credits', 'cost_duckets', 'cost_diamonds'];
#[\Override]
public $timestamps = false;
public function itemBase(): BelongsTo
{
return $this->belongsTo(ItemBase::class, 'item_ids', 'id');
}
}
+25
View File
@@ -0,0 +1,25 @@
<?php
namespace App\Models\Game\Furniture;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
/**
* @method static \Illuminate\Database\Eloquent\Builder<static>|CatalogPage find($id, $columns = ['*'])
* @method static \Illuminate\Database\Eloquent\Builder<static>|CatalogPage pluck($column, $key = null)
* @method static \Illuminate\Database\Eloquent\Builder<static>|CatalogPage whereKey($id)
*/
class CatalogPage extends Model
{
#[\Override]
protected $guarded = ['id', 'parent_id'];
#[\Override]
public $timestamps = false;
public function catalogItems(): HasMany
{
return $this->hasMany(CatalogItem::class, 'page_id');
}
}
+19
View File
@@ -0,0 +1,19 @@
<?php
declare(strict_types=1);
namespace App\Models\Game\Furniture;
use App\Models\Concerns\BelongsToUser;
use Illuminate\Database\Eloquent\Model;
class Item extends Model
{
use BelongsToUser;
#[\Override]
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'item_id', 'room_id'];
#[\Override]
public $timestamps = false;
}
+56
View File
@@ -0,0 +1,56 @@
<?php
namespace App\Models\Game\Furniture;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
/**
* @property int $id
* @property string $item_name
* @property string $public_name
* @property int $width
* @property int $length
* @property float $stack_height
* @property bool $allow_stack
* @property bool $allow_sit
* @property bool $allow_lay
* @property bool $allow_walk
* @property string $sprite_id
* @property bool $allow_recycle
* @property bool $allow_trade
* @property bool $allow_marketplace_sell
* @property bool $allow_gift
* @property bool $allow_inventory_stack
* @property string $interaction_type
* @property int $vending_ids
* @property int $is_ambience
* @property bool $no_effect
* @property int $effect_id
* @property-read Collection<int, CatalogItem> $catalogItems
*
* @method static \Illuminate\Database\Eloquent\Builder<static>|ItemBase whereIn($column, $values, $boolean = 'and', $not = false)
* @method static \Illuminate\Database\Eloquent\Builder<static>|ItemBase get($columns = ['*'])
*/
class ItemBase extends Model
{
#[\Override]
protected $table = 'items_base';
#[\Override]
protected $guarded = ['id', 'created_at', 'updated_at', 'sprite_id', 'public_name'];
#[\Override]
public $timestamps = false;
public function icon(): string
{
return sprintf('%s/%s_icon.png', setting('furniture_icons_path'), $this->item_name);
}
public function catalogItems(): HasMany
{
return $this->hasMany(CatalogItem::class, 'item_ids', 'id');
}
}