mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-03 14:10:57 +08:00
30 lines
592 B
PHP
30 lines
592 B
PHP
<?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()
|
|
{
|
|
return $this->belongsTo(Forum::class. 'forumid');
|
|
}
|
|
|
|
public function firstPost()
|
|
{
|
|
return $this->belongsTo(Post::class, "firstpost");
|
|
}
|
|
|
|
public function lastPost()
|
|
{
|
|
return $this->belongsTo(Post::class, "lastpost");
|
|
}
|
|
}
|