🆙 Added fixed cms

This commit is contained in:
Remco
2026-01-07 19:32:43 +01:00
parent fdb0dc276d
commit 711fa2c29e
3992 changed files with 183381 additions and 0 deletions
@@ -0,0 +1,18 @@
<?php
namespace App\Models\Game\Furniture;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class CatalogItem extends Model
{
protected $guarded = ['id'];
public $timestamps = false;
public function itemBase(): BelongsTo
{
return $this->belongsTo(ItemBase::class, 'item_ids', 'id');
}
}
@@ -0,0 +1,18 @@
<?php
namespace App\Models\Game\Furniture;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class CatalogPage extends Model
{
protected $guarded = [];
public $timestamps = false;
public function catalogItems(): HasMany
{
return $this->hasMany(CatalogItem::class, 'page_id');
}
}
@@ -0,0 +1,19 @@
<?php
namespace App\Models\Game\Furniture;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Item extends Model
{
protected $guarded = ['id'];
public $timestamps = false;
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}
@@ -0,0 +1,25 @@
<?php
namespace App\Models\Game\Furniture;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class ItemBase extends Model
{
protected $table = 'items_base';
protected $guarded = ['id'];
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');
}
}
@@ -0,0 +1,18 @@
<?php
namespace App\Models\Game\Guild;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Guild extends Model
{
protected $guarded = ['id'];
public $timestamps = false;
public function members(): HasMany
{
return $this->hasMany(GuildMember::class);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Models\Game\Guild;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class GuildMember extends Model
{
protected $table = 'guilds_members';
protected $guarded = ['id'];
public $timestamps = false;
public function guilds(): HasMany
{
return $this->hasMany(Guild::class);
}
}
@@ -0,0 +1,43 @@
<?php
namespace App\Models\Game;
use App\Models\Compositions\HasBadge;
use App\Models\StaffApplication;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Permission extends Model implements HasBadge
{
protected $table = 'permissions';
public $timestamps = false;
protected $guarded = ['id', 'rank_name'];
public function users(): HasMany
{
return $this->hasMany(User::class, 'rank', 'id');
}
public function roles(): HasMany
{
return $this->hasMany(PermissionRole::class);
}
public function staffApplications(): HasMany
{
return $this->hasMany(StaffApplication::class, 'rank_id');
}
public function getBadgePath(): string
{
return sprintf('%s%s.gif', setting('badges_path'), $this->getBadgeName());
}
public function getBadgeName(): string
{
return $this->badge;
}
}
@@ -0,0 +1,15 @@
<?php
namespace App\Models\Game\Player;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class MessengerFriendship extends Model
{
public function user(): BelongsTo
{
return $this->belongsTo(User::class, 'user_two_id', 'id');
}
}
@@ -0,0 +1,23 @@
<?php
namespace App\Models\Game\Player;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class UserBadge extends Model
{
protected $table = 'users_badges';
protected $primaryKey = 'user_id';
protected $guarded = [];
public $timestamps = false;
public function user(): BelongsTo
{
return $this->belongsTo(User::class, 'id');
}
}
@@ -0,0 +1,23 @@
<?php
namespace App\Models\Game\Player;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class UserCurrency extends Model
{
protected $guarded = [];
protected $table = 'users_currency';
protected $primaryKey = 'user_id';
public $timestamps = false;
public function user(): BelongsTo
{
return $this->belongsTo(User::class, 'user_id', 'id');
}
}
@@ -0,0 +1,21 @@
<?php
namespace App\Models\Game\Player;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class UserSetting extends Model
{
protected $table = 'users_settings';
protected $guarded = ['id'];
public $timestamps = false;
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}
@@ -0,0 +1,19 @@
<?php
namespace App\Models\Game\Player;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class UserSubscription extends Model
{
protected $table = 'users_subscriptions';
public $timestamps = false;
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}
+24
View File
@@ -0,0 +1,24 @@
<?php
namespace App\Models\Game;
use App\Models\Game\Guild\Guild;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasOne;
class Room extends Model
{
protected $guarded = ['id'];
public function guild(): HasOne
{
return $this->hasOne(Guild::class, 'room_id');
}
public function owner(): BelongsTo
{
return $this->belongsTo(User::class, 'owner_id', 'id');
}
}