Skip to content

Assignment ​

File: src/Entities/Assignment.php
Namespace: Unusualify\Modularous\Entities
Extends: Illuminate\Database\Eloquent\Model
Traits: SoftDeletes, AssignmentScopes, HasFileponds

Task assignment model with polymorphic relationships to the assignable target, assignee, and assigner. Tracks status via the AssignmentStatus enum with due dates, completion timestamps, and file attachments.

Fillable Attributes ​

AttributeTypeDescription
assignable_idintTarget model ID
assignable_typestringTarget model class
assignee_idintAssigned-to user/model ID
assignee_typestringAssigned-to model class
assigner_idintAssigned-by user ID (auto-set from auth)
assigner_typestringAssigned-by model class (auto-set from auth)
statusAssignmentStatusCurrent status (enum cast)
titlestringAssignment title
descriptionstringDescription/instructions
due_atdatetimeDeadline
accepted_atdatetimeWhen the assignee accepted
completed_atdatetimeWhen the assignment was completed

Boot Events ​

EventAction
creatingAuto-fills assigner_id and assigner_type from the authenticated user
createdDispatches AssignmentCreated
updatedDispatches AssignmentUpdated

Relationships ​

assignable(): MorphTo ​

The target entity this assignment refers to.

assignee(): MorphTo ​

The user or model the task is assigned to.

assigner(): MorphTo ​

The user who created the assignment.

Accessors ​

AccessorTypeDescription
assignee_namestringAssignee's name or email
assignee_avatarstringAssignee's avatar URL
assigner_namestringAssigner's name or email
status_labelstringHuman-readable status
status_colorstringStatus colour for the UI
status_iconstringStatus icon identifier
status_icon_colorstringIcon colour
status_interval_descriptionstringTime-related label (due/completed/updated) with formatted date
status_vuetify_iconstringVuetify <v-icon> HTML snippet
attachmentsCollectionFilepond uploads with role attachments
preliminariesCollectionFilepond uploads with role preliminaries

AssignmentStatus Enum ​

PENDING, ACCEPTED, COMPLETED, CANCELLED, REJECTED — each value provides label(), color(), icon(), iconColor(), and timeIntervalDescription().