Skip to content

Entity Traits ​

Modularous ships a comprehensive set of Eloquent model traits organized into four groups. Mix and match them on your models to compose the exact feature set needed.

Trait Groups ​

GroupNamespacePurpose
Top-LevelUnusualify\Modularous\Entities\Traits\Core domain behaviors — relationships, media, state, slugs, etc.
CoreUnusualify\Modularous\Entities\Traits\Core\Low-level plumbing — caching, scopes, change tracking, locale tags
AuthUnusualify\Modularous\Entities\Traits\Auth\Authentication helpers — OAuth linking, email-verification registration
SecondaryUnusualify\Modularous\Entities\Traits\Secondary\Optional extras — nesting, blocks, revisions, related items

Top-Level Traits ​

TraitPageSummary
AssignableAssignableUser/role assignment with assignments() morph relation
ChatableChatableAuto-created Chat thread + messages per model
HasAuthorizableHasAuthorizablePer-record authorization (Authorization morph)
HasCreatorHasCreatorTracks the User who created the record
HasFilepondsHasFilepondsFilepond temp-file tracking with collection management
HasFilesHasFilesFile attachments via MorphToMany to File
HasImagesHasImagesMedia library attachments with crop/param helpers
HasPaymentHasPaymentPayment/price state with full status helpers
HasPriceableHasPriceableBase pricing with currency exchange support
HasPositionHasPositionAuto-position assignment and setNewOrder()
HasPresenterHasPresenterPresenter pattern (present(), presentAdmin())
HasProcessesHasProcessesApproval workflow processes via morph relation
HasRepeatersHasRepeatersNested repeater blocks (media + filepond + pricing)
HasScopes (deprecated)Deprecated →Alias for Core\HasScopes
HasSlugHasSlugSlug generation and resolveRouteBinding() via slug
HasSpreadableHasSpreadableJSON spread attributes as dynamic model properties
HasStateableHasStateableState machine with event dispatch
HasTranslationHasTranslationMulti-locale content via astrotomic/laravel-translatable
HasUuidHasUuidAuto UUID primary key (ordered_uuid)
IsHostableIsHostableSlug + hostable route resolution across parent hierarchy
IsSingularIsSingularSingleton model stored in shared modularous_singletons table
IsTranslatableIsTranslatableCheck helper — detects if model uses translations
ModelHelpers (deprecated)Deprecated →Alias for Core\ModelHelpers
ProcessableProcessableSingle-process workflow: confirm / reject flow

Core Traits ​

TraitPageSummary
Core\ModelHelpersModelHelpersComposes scopes, routes, activity logging, title helpers
Core\HasScopesHasScopespublished, visible, draft, global scope wiring
Core\HasCachingHasCachingAuto cache invalidation via CacheObserver
Core\HasCacheDependentsHasCacheDependentsCross-model cache dependency graph
Core\HasCompanyHasCompanyCompany association with auto-create on save
Core\ChangeRelationshipsChangeRelationshipsTracks which relationships changed during a request
Core\LocaleTagsLocaleTagsLocale-scoped tagging (tagLocale, untagLocale)

Auth Traits ​

TraitPageSummary
Auth\CanRegisterCanRegisterEmail-verification token dispatch for registration flow
Auth\HasOauthHasOauthOAuth provider linking (UserOauth has-many)

Secondary Traits ​

TraitPageSummary
Secondary\HasBlocksHasBlocksContent blocks (morph-many, ordered, rendered)
Secondary\HasNestingHasNestingNested-set slug traversal and tree save
Secondary\HasRelatedHasRelatedRelated-item linking via morph-many pivot
Secondary\HasRelationHasRelationMinimal stub — forceDeleting hook placeholder
Secondary\HasRevisionsHasRevisionsRevision history (has-many, descending)