<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;

class Tag extends Model
{
    protected $fillable = [
        'title',
        'slug',
        'meta_title',
        'meta_description',
    ];
    public function posts(): BelongsToMany
    {
      return $this->belongsToMany(Post::class, 'tag_posts', 'tag_id', 'post_id');
    }
}
