*/ protected $fillable = [ 'label', 'published', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'published' => 'boolean', ]; // * METHODS /** * Create a SchemaOrg. */ public function toSchemaOrg(): DefinedTermSet { return Schema::definedTermSet() ->hasDefinedTerm( Schema::definedTerm()->name($this->label) ); } // * RELATIONSHIPS /** * Get all of the products for the product type. */ public function products(): MorphToMany { return $this->morphToMany(Product::class, 'productable'); } }