for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Adminetic\Website\Models\Admin;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphToMany;
class Tag extends Model
{
use HasFactory;
protected $fillable = ['name', 'slug'];
public function __construct(array $attributes = [])
$this->table = config('website.table_prefix', 'website').'_tags';
parent::__construct($attributes);
}
/**
* Get all of the posts that are assigned this tag.
*/
public function posts(): MorphToMany
return $this->morphedByMany(Post::class, 'taggable');