progress
This commit is contained in:
@@ -2,9 +2,23 @@
|
||||
|
||||
namespace App\Models\Forum;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Post extends Model
|
||||
{
|
||||
//
|
||||
protected $table = 'forum_posts';
|
||||
|
||||
protected $fillable = [
|
||||
'content',
|
||||
'user_id',
|
||||
'category_id',
|
||||
'thread_id',
|
||||
'topic_id',
|
||||
];
|
||||
|
||||
public function author()
|
||||
{
|
||||
return $this->hasOne(User::class, 'id', 'user_id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,4 +7,9 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Thread extends Model
|
||||
{
|
||||
protected $table = 'forum_threads';
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->hasOne(Category::class, 'id', 'category_id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@ class Topic extends Model
|
||||
{
|
||||
protected $table = 'forum_topics';
|
||||
|
||||
public const STATUS_OPEN = 'open';
|
||||
public const STATUS_CLOSED = 'closed';
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'slug',
|
||||
@@ -15,5 +18,7 @@ class Topic extends Model
|
||||
'category_id',
|
||||
'thread_id',
|
||||
'user_id',
|
||||
'views_no',
|
||||
'replies_no',
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user