You've already forked Atomcms-edit
Initial commit
This commit is contained in:
Executable
+37
@@ -0,0 +1,37 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user