You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now the tags relation is defined as morphToMany and the TaggableTrait is included on each twill model (even translations and slugs)
This doesn't make much sense from a separation of concern standpoint and likely causes unnecessary overhead
Describe the solution you'd like
A trait HasTags or IsTaggable instead of the method included in each model
Additional context
Right now this causes issues (as well as pollutes the generated phpdoc) when using Relation::enforceMorphMap and laravel-ide-helper because the tags method is on models which have no business in being included in the morphMap
Error resolving relation model of App\Models\Slugs\VideoSlug:tags() : No morph map defined for model [App\Models\Slugs\VideoSlug].
Error resolving relation model of App\Twill\Capsules\Pages\Models\PageSlug:tags() : No morph map defined for model [App\Twill\Capsules\Pages\Models\PageSlug].
Error resolving relation model of App\Twill\Capsules\Pages\Models\PageTranslation:tags() : No morph map defined for model [App\Twill\Capsules\Pages\Models\PageTranslation].
This would need to be on v4 because of the breaking change
Maybe we also need different levels of Twill\Model maybe one for Slug and one for Translation just like we already have one for Revisions to avoid the overhead of the base model in Translation and Slug models, this can be done in v3 without a breaking change and would already solve a big part of the issue at hand
The text was updated successfully, but these errors were encountered:
Summary
Right now the
tags
relation is defined asmorphToMany
and the TaggableTrait is included on each twill model (even translations and slugs)This doesn't make much sense from a separation of concern standpoint and likely causes unnecessary overhead
Describe the solution you'd like
A trait
HasTags
orIsTaggable
instead of the method included in each modelAdditional context
Right now this causes issues (as well as pollutes the generated phpdoc) when using
Relation::enforceMorphMap
andlaravel-ide-helper
because the tags method is on models which have no business in being included in the morphMapThis would need to be on v4 because of the breaking change
Maybe we also need different levels of
Twill\Model
maybe one forSlug
and one forTranslation
just like we already have one forRevisions
to avoid the overhead of the base model in Translation and Slug models, this can be done in v3 without a breaking change and would already solve a big part of the issue at handThe text was updated successfully, but these errors were encountered: