prepared and gallery fixes
This commit is contained in:
33
app/Models/ForumThread.php
Normal file
33
app/Models/ForumThread.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class ForumThread extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'forum_threads';
|
||||
|
||||
protected $fillable = [
|
||||
'id','category_id','user_id','title','slug','content','views','is_locked','is_pinned','visibility','last_post_at'
|
||||
];
|
||||
|
||||
public $incrementing = true;
|
||||
|
||||
protected $casts = [
|
||||
'last_post_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->belongsTo(ForumCategory::class, 'category_id');
|
||||
}
|
||||
|
||||
public function posts()
|
||||
{
|
||||
return $this->hasMany(ForumPost::class, 'thread_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user