2025-01-27 22:40:26 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models\Forum;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
class Topic extends Model
|
|
|
|
|
{
|
2025-02-10 01:58:12 +02:00
|
|
|
protected $table = 'forum_topics';
|
|
|
|
|
|
2025-02-16 21:11:07 +02:00
|
|
|
public const STATUS_OPEN = 'open';
|
|
|
|
|
public const STATUS_CLOSED = 'closed';
|
|
|
|
|
|
2025-02-10 01:58:12 +02:00
|
|
|
protected $fillable = [
|
|
|
|
|
'name',
|
|
|
|
|
'slug',
|
|
|
|
|
'status',
|
|
|
|
|
'category_id',
|
|
|
|
|
'thread_id',
|
|
|
|
|
'user_id',
|
2025-02-16 21:11:07 +02:00
|
|
|
'views_no',
|
|
|
|
|
'replies_no',
|
2025-02-10 01:58:12 +02:00
|
|
|
];
|
2025-08-16 15:38:07 +03:00
|
|
|
|
|
|
|
|
public function author()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(\App\Models\User::class, 'user_id');
|
|
|
|
|
}
|
2025-01-27 22:40:26 +02:00
|
|
|
}
|