30 lines
531 B
PHP
30 lines
531 B
PHP
<?php
|
|
|
|
namespace App\Models\Forum;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Topic extends Model
|
|
{
|
|
protected $table = 'forum_topics';
|
|
|
|
public const STATUS_OPEN = 'open';
|
|
public const STATUS_CLOSED = 'closed';
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'slug',
|
|
'status',
|
|
'category_id',
|
|
'thread_id',
|
|
'user_id',
|
|
'views_no',
|
|
'replies_no',
|
|
];
|
|
|
|
public function author()
|
|
{
|
|
return $this->belongsTo(\App\Models\User::class, 'user_id');
|
|
}
|
|
}
|