🆙 More fixes 🆙

This commit is contained in:
Remco
2026-01-19 21:04:53 +01:00
parent 451b7edda3
commit 8d3115678c
10 changed files with 75 additions and 21 deletions
+14 -6
View File
@@ -3,13 +3,12 @@
namespace App\Models;
use App\Models\Game\Room;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class ChatlogRoom extends Model
{
use HasFactory;
protected $table = 'chatlogs_room';
protected $guarded = [];
@@ -18,17 +17,26 @@ class ChatlogRoom extends Model
protected $primaryKey = 'timestamp';
public function room()
/**
* @return BelongsTo<Room, $this>
*/
public function room(): BelongsTo
{
return $this->belongsTo(Room::class);
}
public function sender()
/**
* @return BelongsTo<User, $this>
*/
public function sender(): BelongsTo
{
return $this->belongsTo(User::class, 'user_from_id');
}
public function receiver()
/**
* @return BelongsTo<User, $this>
*/
public function receiver(): BelongsTo
{
return $this->belongsTo(User::class, 'user_to_id');
}