$products * @property-read \Illuminate\Database\Eloquent\Collection<\App\Models\Keyword> $keywordables */ class Keyword extends Model { /** * @var array */ protected $fillable = [ 'label', 'keyword_cat', 'created_at', 'updated_at' ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'keyword_cat' => KeywordCategoryEnum::class ]; // * RELATIONSHIPS /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function keywordables() { return $this->hasMany(Keywordable::class); } /** * MorphToMany products relation. * * @return \Illuminate\Database\Eloquent\Relations\MorphToMany */ public function products() { return $this->morphToMany(Product::class, 'keywordable'); } }