You've already forked Atomcms-edit
38 lines
838 B
PHP
Executable File
38 lines
838 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Models\User;
|
|
|
|
use App\Models\Concerns\BelongsToUser;
|
|
use App\Models\ItemDefinition;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
/**
|
|
* @property int $id
|
|
* @property int $user_id
|
|
* @property int $item_id
|
|
* @property int $room_id
|
|
* @property string $extra_data
|
|
* @property-read User|null $user
|
|
* @property-read ItemDefinition|null $itemDefinition
|
|
*/
|
|
class UserItem extends Model
|
|
{
|
|
use BelongsToUser;
|
|
|
|
#[\Override]
|
|
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'item_id'];
|
|
|
|
#[\Override]
|
|
public $timestamps = false;
|
|
|
|
#[\Override]
|
|
protected $table = 'user_items';
|
|
|
|
public function itemDefinition(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ItemDefinition::class, 'item_id');
|
|
}
|
|
}
|