*/ protected $fillable = [ 'label', 'published', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'published' => 'boolean', ]; // * RELATIONSHIPS /** * Get all of the products for the product type. * * @return \Illuminate\Database\Eloquent\Relations\MorphToMany */ public function products(): \Illuminate\Database\Eloquent\Relations\MorphToMany { return $this->morphToMany(Product::class, 'productable'); } }