You've already forked Epicnabbo-Catalogus-Updated-Daily
44 lines
842 B
PHP
44 lines
842 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Game\Room;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class ChatlogRoom extends Model
|
|
{
|
|
protected $table = 'chatlogs_room';
|
|
|
|
protected $guarded = [];
|
|
|
|
public $timestamps = false;
|
|
|
|
protected $primaryKey = 'timestamp';
|
|
|
|
/**
|
|
* @return BelongsTo<Room, $this>
|
|
*/
|
|
public function room(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Room::class);
|
|
}
|
|
|
|
/**
|
|
* @return BelongsTo<User, $this>
|
|
*/
|
|
public function sender(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'user_from_id');
|
|
}
|
|
|
|
/**
|
|
* @return BelongsTo<User, $this>
|
|
*/
|
|
public function receiver(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'user_to_id');
|
|
}
|
|
}
|