2022-06-18 13:16:36 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Topic extends NexusModel
|
|
|
|
|
{
|
|
|
|
|
protected $fillable = ['userid', 'subject', 'locked', 'forumid', 'firstpost', 'lastpost', 'sticky', 'hlcolor', 'views'];
|
|
|
|
|
|
|
|
|
|
public function user()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(User::class, 'userid');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function forum()
|
|
|
|
|
{
|
2025-09-16 00:32:45 +08:00
|
|
|
return $this->belongsTo(Forum::class, 'forumid');
|
2022-06-18 13:16:36 +08:00
|
|
|
}
|
2024-04-05 22:40:06 +08:00
|
|
|
|
|
|
|
|
public function firstPost()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Post::class, "firstpost");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function lastPost()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Post::class, "lastpost");
|
|
|
|
|
}
|
2022-06-18 13:16:36 +08:00
|
|
|
}
|