*/ use HasFactory; /** * The attributes that are mass assignable. * * @var list */ protected $fillable = [ 'title', 'content', 'category_id', ]; /** * @return BelongsTo */ public function category() { return $this->belongsTo(Category::class); } /** * @return BelongsToMany */ public function tags() { return $this->belongsToMany(Tag::class); } /** * @return \Illuminate\Database\Eloquent\Relations\MorphMany */ public function comments() { return $this->morphMany(Comment::class, 'commentable'); } }