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 ​
| Group | Namespace | Purpose |
|---|---|---|
| Top-Level | Unusualify\Modularous\Entities\Traits\ | Core domain behaviors — relationships, media, state, slugs, etc. |
| Core | Unusualify\Modularous\Entities\Traits\Core\ | Low-level plumbing — caching, scopes, change tracking, locale tags |
| Auth | Unusualify\Modularous\Entities\Traits\Auth\ | Authentication helpers — OAuth linking, email-verification registration |
| Secondary | Unusualify\Modularous\Entities\Traits\Secondary\ | Optional extras — nesting, blocks, revisions, related items |
Top-Level Traits ​
| Trait | Page | Summary |
|---|---|---|
Assignable | Assignable | User/role assignment with assignments() morph relation |
Chatable | Chatable | Auto-created Chat thread + messages per model |
HasAuthorizable | HasAuthorizable | Per-record authorization (Authorization morph) |
HasCreator | HasCreator | Tracks the User who created the record |
HasFileponds | HasFileponds | Filepond temp-file tracking with collection management |
HasFiles | HasFiles | File attachments via MorphToMany to File |
HasImages | HasImages | Media library attachments with crop/param helpers |
HasPayment | HasPayment | Payment/price state with full status helpers |
HasPriceable | HasPriceable | Base pricing with currency exchange support |
HasPosition | HasPosition | Auto-position assignment and setNewOrder() |
HasPresenter | HasPresenter | Presenter pattern (present(), presentAdmin()) |
HasProcesses | HasProcesses | Approval workflow processes via morph relation |
HasRepeaters | HasRepeaters | Nested repeater blocks (media + filepond + pricing) |
HasScopes (deprecated) | Deprecated → | Alias for Core\HasScopes |
HasSlug | HasSlug | Slug generation and resolveRouteBinding() via slug |
HasSpreadable | HasSpreadable | JSON spread attributes as dynamic model properties |
HasStateable | HasStateable | State machine with event dispatch |
HasTranslation | HasTranslation | Multi-locale content via astrotomic/laravel-translatable |
HasUuid | HasUuid | Auto UUID primary key (ordered_uuid) |
IsHostable | IsHostable | Slug + hostable route resolution across parent hierarchy |
IsSingular | IsSingular | Singleton model stored in shared modularous_singletons table |
IsTranslatable | IsTranslatable | Check helper — detects if model uses translations |
ModelHelpers (deprecated) | Deprecated → | Alias for Core\ModelHelpers |
Processable | Processable | Single-process workflow: confirm / reject flow |
Core Traits ​
| Trait | Page | Summary |
|---|---|---|
Core\ModelHelpers | ModelHelpers | Composes scopes, routes, activity logging, title helpers |
Core\HasScopes | HasScopes | published, visible, draft, global scope wiring |
Core\HasCaching | HasCaching | Auto cache invalidation via CacheObserver |
Core\HasCacheDependents | HasCacheDependents | Cross-model cache dependency graph |
Core\HasCompany | HasCompany | Company association with auto-create on save |
Core\ChangeRelationships | ChangeRelationships | Tracks which relationships changed during a request |
Core\LocaleTags | LocaleTags | Locale-scoped tagging (tagLocale, untagLocale) |
Auth Traits ​
| Trait | Page | Summary |
|---|---|---|
Auth\CanRegister | CanRegister | Email-verification token dispatch for registration flow |
Auth\HasOauth | HasOauth | OAuth provider linking (UserOauth has-many) |
Secondary Traits ​
| Trait | Page | Summary |
|---|---|---|
Secondary\HasBlocks | HasBlocks | Content blocks (morph-many, ordered, rendered) |
Secondary\HasNesting | HasNesting | Nested-set slug traversal and tree save |
Secondary\HasRelated | HasRelated | Related-item linking via morph-many pivot |
Secondary\HasRelation | HasRelation | Minimal stub — forceDeleting hook placeholder |
Secondary\HasRevisions | HasRevisions | Revision history (has-many, descending) |