Appearance
DAM Models ​
Overview ​
The 47 Eloquent models in app/Models/DAM/ (namespace App\Models\DAM). They cover the asset library, portals, sharing, notifications, the asset ordering cart and DAM subscriptions. Everything on this page is read from the model files at commit f517b6b. Where a model has no $fillable, the column list comes from database/migrations (including database/migrations/update).
Product terms used in the UI map to these models:
| UI term | Model | Table |
|---|---|---|
| Asset | DigitalAssets | digital_assets |
| Asset version | AssetsVersion | assets_versions |
| Folder | DigitalAssetsCategory | digital_assets_categories |
| Collage | DamCollection, pivot DamCollectionAssets | dam_collections, dam_collection_assets |
| Tag | DigitalAssetsTag | digital_assets_tags |
| Custom field and its value on an asset | CustomField, AssetsCustomField | custom_fields, assets_custom_fields |
| Portal | DamInstance | dam_instances |
| Portal visibility of a folder, asset or Collage | DamInstancePermission (polymorphic) | dam_instance_permissions |
| Portal tiles and banners | DamTile, InstanceBanner | dam_tiles, instance_banners |
Portal user (logs in with the dam-api guard) | DealerUsers | dealer_users |
| Share link | ShareAssetsCategory | share_assets_category |
External app (API key, external-api guard) | DamExternalApp | dam_external_apps |
Notes that apply across the folder:
DamInstancePermissionis a polymorphic table.permissionable_typestores the full class name (for exampleApp\Models\DAM\DigitalAssetsCategory); there is no morph map.DigitalAssets,DigitalAssetsCategoryandDamCollectionexpose it asinstancePermissions()(morphMany).- Four models use Laravel Scout with the Typesense collection schemas defined in
config/scout.php:DigitalAssets,DigitalAssetsCategory,DamCollection,DigitalAssetsTag. None overridesearchableAs(), so the index name is the table name plus the optionalSCOUT_PREFIX.shouldBeSearchable()keeps archived, deleted and uncategorised assets out of the index (DigitalAssets), drops trashed folders (DigitalAssetsCategory), and drops tags whose asset is archived, deleted or uncategorised (DigitalAssetsTag). DealerUserInvitationsexists in bothApp\Models\DAMandApp\Models\LMwith the same default tabledealer_user_invitations.Addonpoints at tableadd_ons; no migration for that table exists in the snapshot.
See also: Models overview, LM models, Core models.
Inventory ​
| Model | Table | Traits | Relations |
|---|---|---|---|
| Addon | add_ons | HasFactory | 0 |
| AssetsCustomField | assets_custom_fields | - | 2 |
| AssetsVersion | assets_versions | - | 2 |
| Coupons | coupons | HasFactory | 0 |
| CustomField | custom_fields | SoftDeletes | 1 |
| DAMUserAddress | dam_user_addresses | HasFactory | 0 |
| DamAcl | dam_acl | - | 0 |
| DamAssetOrderSetting | dam_asset_order_settings | - | 0 |
| DamAssetProduct | dam_asset_products | - | 1 |
| DamAssetProductCart | dam_asset_product_carts | - | 3 |
| DamAssetProductOrder | dam_asset_product_orders | - | 4 |
| DamAssetProductOrderItem | dam_asset_product_order_items | - | 3 |
| DamAssetProductOrderShipping | dam_asset_product_order_shippings | - | 0 |
| DamAssetWatermarkSetting | dam_asset_watermark_settings | - | 0 |
| DamAssetsConvert | dam_assets_converts | HasFactory, SoftDeletes | 2 |
| DamCollection | dam_collections | SoftDeletes, Searchable | 3 |
| DamCollectionAssets | dam_collection_assets | - | 1 |
| DamExternalApp | dam_external_apps | HasApiTokens | 0 |
| DamGroup | dam_groups | HasFactory | 2 |
| DamGroupUser | dam_group_users | HasFactory | 0 |
| DamInquiry | dam_inquiry | HasFactory | 1 |
| DamInstance | dam_instances | SoftDeletes | 2 |
| DamInstancePermission | dam_instance_permissions | - | 2 |
| DamInstancesUsers | dam_instances_users | SoftDeletes | 1 |
| DamNotification | dam_notifications | HasFactory | 0 |
| DamNotificationGroup | dam_notification_groups | HasFactory | 1 |
| DamSearchHistory | dam_search_histories | - | 0 |
| DamSystemNotifications | dam_system_notifications | HasFactory | 0 |
| DamTile | dam_tiles | - | 2 |
| DamUserNotifications | dam_user_notifications | HasFactory | 1 |
| DealerUserInvitations | dealer_user_invitations | - | 1 |
| DealerUsers | dealer_users | HasApiTokens, Notifiable, SoftDeletes | 3 |
| DealerUsersActivity | dealer_users_activities | - | 0 |
| DigitalAssets | digital_assets | Searchable | 14 |
| DigitalAssetsCategory | digital_assets_categories | SoftDeletes, Searchable | 7 |
| DigitalAssetsDownload | digital_assets_downloads | - | 0 |
| DigitalAssetsTag | digital_assets_tags | Searchable | 1 |
| ImportData | import_data | HasFactory | 0 |
| InstanceBanner | instance_banners | SoftDeletes | 1 |
| ShareAssetsCategory | share_assets_category | SoftDeletes | 0 |
| SubscriptionAddon | subscription_addons | HasFactory | 0 |
| SubscriptionUserActivity | subscription_user_activities | - | 1 |
| SubscriptionUserAddon | subscription_user_addons | HasFactory, SoftDeletes | 1 |
| SubscriptionUsers | subscription_users | HasFactory | 4 |
| Subscriptions | subscriptions | HasFactory | 1 |
| TransactionActivity | transaction_activities | HasFactory | 0 |
| WorkspaceRestructureData | workspace_restructure_data | - | 0 |
Models ​
Addon ​
app/Models/DAM/Addon.php · table add_ons · traits HasFactory
Fillable: price, tokens, is_active, created_at, updated_at
AssetsCustomField ​
app/Models/DAM/AssetsCustomField.php · table assets_custom_fields
Fillable: workspace_id, asset_id, custom_field_id, value, status
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
customField() | belongsTo | CustomField | - | - |
asset() | belongsTo | DigitalAssets | - | - |
AssetsVersion ​
app/Models/DAM/AssetsVersion.php · table assets_versions (default)
Fillable: id, asset_id, version, workspace_id, user_id, file_name, display_file_name, file_type, file_size, height, width, terms_of_use, description, auto_tag, type, category_id, is_categorized, file_meta_data, checksum_value, thumbnail_file, compress_file, video_preview, is_public, is_embed_code, embed_key, embed_code_date, visible_in_trashed, is_archive, is_deleted, final_deleted, is_recent, is_editorial_use, file_preview_id, file_preview_status, created_at, updated_at
Casts: width → integer, height → integer
Appends: preview_image, embed_code
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
user() | belongsTo | User | user_id, id | ->select('id', 'name', 'email', 'profile_image') |
workspace() | belongsTo | Workspace | workspace_id, id | - |
Scopes: downloadAssetQry, excludeAdmin, customWhere, assetSizeQry
Accessors: getDisplayFileAttribute, getPreviewImageAttribute, getThumbnailFileAttribute, getVideoPreviewAttribute, getCompressFileAttribute, getEmbedCodeAttribute, getCollectionAttribute
Other methods: generateEmbedUrl(), enableEmbedCode()
Model events (booted): saving throws InvalidArgumentException('Invalid asset file name.') when a changed file_name is not a plain file name (UploadedObjectUrl::isPlainFileName(): 1-255 characters, no /, \, .. or control characters), so a stored name cannot escape the <slug>/digital_assets/ S3 prefix.
Coupons ​
app/Models/DAM/Coupons.php · table coupons (default) · traits HasFactory
Mass assignment: no $fillable or $guarded, so Laravel default $guarded = ['*'] applies.
Columns (from migrations): id, name, code, type, value, plans, expiration_date, total_redeemed, is_active, created_at, updated_at
CustomField ​
app/Models/DAM/CustomField.php · table custom_fields · traits SoftDeletes
Fillable: workspace_id, field_type, field_label, field_value, field_settings, placeholder_text, admin_only, status
Casts: field_value → CustomFieldOptions::class, field_settings → FlexibleJson::class
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
assetsCustomFields() | hasMany | AssetsCustomField | custom_field_id | - |
DAMUserAddress ​
app/Models/DAM/DAMUserAddress.php · table dam_user_addresses · traits HasFactory
Fillable: id, workspace_id, user_id, user_name, user_email, user_phone, address1, address2, city, state, county, zip_code, company_name, created_at, updated_at
DamAcl ​
app/Models/DAM/DamAcl.php · table dam_acl
Fillable: id, workspace_id, user_id, name, position, is_active
Hidden: deleted_at
DamAssetOrderSetting ​
app/Models/DAM/DamAssetOrderSetting.php · table dam_asset_order_settings (default)
Mass assignment: no $fillable or $guarded, so Laravel default $guarded = ['*'] applies.
Columns (from migrations): id, workspace_id, user_id, admin_id, is_sku_automatic, workspace_abbreviation, product_number, is_prefix, is_suffix, is_required, is_order_automatic, order_number, created_at, updated_at
DamAssetProduct ​
app/Models/DAM/DamAssetProduct.php · table dam_asset_products (default)
Mass assignment: no $fillable or $guarded, so Laravel default $guarded = ['*'] applies.
Columns (from migrations): id, workspace_id, asset_id, user_id, sku, unit, pricing_option, options, is_product, is_customize, created_at, updated_at, sku_number
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
asset() | belongsTo | DigitalAssets | asset_id, id | - |
DamAssetProductCart ​
app/Models/DAM/DamAssetProductCart.php · table dam_asset_product_carts (default)
Mass assignment: no $fillable or $guarded, so Laravel default $guarded = ['*'] applies.
Columns (from migrations): id, workspace_id, user_id, asset_id, asset_version_id, asset_product_id, display_file_name, file_name, file_type, qty, unit, base_price, created_at, updated_at, selected_option, total_amount, base_qty
Appends: original_file_name
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
asset() | belongsTo | DigitalAssets | asset_id, id | - |
product() | belongsTo | DamAssetProduct | asset_product_id, id | - |
workspace() | belongsTo | Workspace | workspace_id, id | - |
Scopes: assetUserPermission
Accessors: getFileNameAttribute, getOriginalFileNameAttribute
DamAssetProductOrder ​
app/Models/DAM/DamAssetProductOrder.php · table dam_asset_product_orders (default)
Fillable: is_dismiss
Appends: status_id, status_color, status_background_color, mobile_status_color, mobile_status_background_color
Dates: invoice_date
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
order_item() | hasMany | DamAssetProductOrderItem | order_id, id | - |
shpping_info() | belongsTo | DamAssetProductOrderShipping | id, order_id | - |
user() | belongsTo | DealerUsers | user_id, id | ->select('id', 'name', 'email', 'profile_image') |
workspace() | belongsTo | Workspace | workspace_id, id | - |
Accessors: getStatusAttribute, getStatusIdAttribute, getStatusColorAttribute, getStatusBackgroundColorAttribute, getMobileStatusColorAttribute, getMobileStatusBackgroundColorAttribute
DamAssetProductOrderItem ​
app/Models/DAM/DamAssetProductOrderItem.php · table dam_asset_product_order_items (default)
Mass assignment: no $fillable or $guarded, so Laravel default $guarded = ['*'] applies.
Columns (from migrations): id, workspace_id, user_id, asset_id, asset_version_id, order_id, display_file_name, file_name, file_type, qty, unit, base_price, created_at, updated_at, total_amount, base_qty
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
workspace() | belongsTo | Workspace | workspace_id, id | - |
asset() | belongsTo | DigitalAssets | asset_id, id | - |
assetProduct() | belongsTo | DigitalAssets | asset_id, id | ->select('id', 'is_public', 'is_archive', 'is_deleted') |
Accessors: getFileNameAttribute
DamAssetProductOrderShipping ​
app/Models/DAM/DamAssetProductOrderShipping.php · table dam_asset_product_order_shippings (default)
Fillable: id, workspace_id, user_id, order_id, shipping_company_name, shipping_user_name, shipping_user_email, shipping_user_phone, address1, address2, city, state, country, zip_code
DamAssetWatermarkSetting ​
app/Models/DAM/DamAssetWatermarkSetting.php · table dam_asset_watermark_settings (default)
Mass assignment: no $fillable or $guarded, so Laravel default $guarded = ['*'] applies.
Columns (from migrations): id, workspace_id, type, text, font_size, font_color, image, image_name, opacity, position, orientation, created_at, updated_at, is_check, image_type, image_size
DamAssetsConvert ​
app/Models/DAM/DamAssetsConvert.php · table dam_assets_converts (default) · traits HasFactory, SoftDeletes
Fillable: id, workspace_id, user_id, asset_id, version_id, file_name, asset_type, convert_type, status, is_backend_user, email_send, is_active, created_at, updated_at
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
workspace() | belongsTo | Workspace | workspace_id, id | - |
version() | belongsTo | AssetsVersion | version_id, id | - |
DamCollection ​
app/Models/DAM/DamCollection.php · table dam_collections (default) · traits SoftDeletes, Searchable
Fillable: id, workspace_id, instance_id, user_id, name, description, is_backend_user, permission_type, permission, group_id, modified_at, visibility
Hidden: deleted_at, visibility, instancePermissions
Appends: assets_count, assets_id, preview_image, preview_images, instance_visibility
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
workspace() | belongsTo | Workspace | workspace_id, id | - |
assets() | hasMany | DamCollectionAssets | collection_id | - |
instancePermissions() | morphMany | DamInstancePermission | permissionable | - |
Scopes: instanceVisible, userPermission
Accessors: getAssetsCountAttribute, getPreviewImageAttribute, getPreviewImagesAttribute, getAssetsIdAttribute, getUserAttribute, getInstanceVisibilityAttribute
Scout / Typesense: indexed through toSearchableArray(); collection schema in config/scout.php has fields id, workspace_id, collection_name, search_name, description, preview_images, instance_visibility, assets_count, created_by, created_at, modified_at, assets_id.
Other methods: getInstancePreviewImages()
DamCollectionAssets ​
app/Models/DAM/DamCollectionAssets.php · table dam_collection_assets (default)
Fillable: collection_id, asset_id
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
assets() | hasMany | DigitalAssets | id, asset_id | - |
DamExternalApp ​
app/Models/DAM/DamExternalApp.php · table dam_external_apps (default) · extends Authenticatable · traits HasApiTokens
Fillable: id, workspace_id, name, url, key, secrete, is_active
DamGroup ​
app/Models/DAM/DamGroup.php · table dam_groups (default) · traits HasFactory
Fillable: id, instance_id, workspace_id, group_icon, group_name
Appends: display_group_icon
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
users() | belongsToMany | DealerUsers | dam_group_users, group_id, user_id | ->select('dealer_users.id', 'dealer_users.name', 'dealer_users.email', 'dealer_users.profile_image') ... |
workspaces() | hasOne | Workspace | id, workspace_id | ->select('id', 'id as workspace_unique_id', 'url_slug as workspace_id', 'name as workspace_name') |
Accessors: getdisplaygroupiconAttribute
Other methods: GroupUserSync()
DamGroupUser ​
app/Models/DAM/DamGroupUser.php · table dam_group_users (default) · traits HasFactory
Mass assignment: no $fillable or $guarded, so Laravel default $guarded = ['*'] applies.
Columns (from migrations): id, workspace_id, group_id, user_id, created_at, updated_at
DamInquiry ​
app/Models/DAM/DamInquiry.php · table dam_inquiry · traits HasFactory
Fillable: id, subscription_id, stripe_customer_id, stripe_payment_id, stripe_subscription_id, coupon_id, name, email, company_name, phone, price, discount, pay_amount, payment_type, payment_status, payment_status_alias, is_active
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
subscription() | belongsTo | Subscriptions | subscription_id, id | - |
DamInstance ​
app/Models/DAM/DamInstance.php · table dam_instances (default) · traits SoftDeletes
Fillable: id, workspace_id, brand_name, description, logo, favicon, url, cname, is_domain, is_pointed, is_slider, is_active, is_public_portal, total_storage_in_gb, used_storage_in_gb, settings, storage_mail_status
Casts: is_domain → integer
Hidden: deleted_at, created_at, updated_at, storage_mail_status
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
workspace() | belongsTo | Workspace | workspace_id | - |
permissions() | hasMany | DamInstancePermission | dam_instance_id | - |
Accessors: getLoginUrlAttribute, getLogoAttribute, getFaviconAttribute, getSettingsAttribute, getStorageMailStatusAttribute
login_url is a signed PortalLoginTicket for this portal (12 hours): for an Admin User a ticket for that user, for a backend DealerUsers a ticket for its backend_login_user_id, otherwise null. Previously it was md5(user id). Constant PUBLIC_PORTAL_EMAIL names the anonymous account of a public portal.
Other methods: checkUser(), damStorageLimitCheck(), workspaceSeatCounts(), checkFeatureRestriction(), checkMailBranding(), formatSubscriptionStorage()
DamInstancePermission ​
app/Models/DAM/DamInstancePermission.php · table dam_instance_permissions (default)
Fillable: dam_instance_id, workspace_id, permissionable_id, permissionable_type, visibility
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
permissionable() | morphTo | (polymorphic) | - | - |
instance() | belongsTo | DamInstance | dam_instance_id | - |
Other methods: bulkUpsertVisibility()
DamInstancesUsers ​
app/Models/DAM/DamInstancesUsers.php · table dam_instances_users (default) · traits SoftDeletes
Fillable: id, instance_id, user_id, instance_status
Hidden: created_at, updated_at, deleted_at
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
instance() | belongsTo | DamInstance | instance_id | - |
DamNotification ​
app/Models/DAM/DamNotification.php · table dam_notifications (default) · traits HasFactory
Fillable: id, workspace_id, notification_name, notification_text, notification_slug, notification_group_id, is_email, is_system, is_organization, is_user, user_recipient, admin_recipient, created_at, updated_at
Other methods: sendEmailNotification()
DamNotificationGroup ​
app/Models/DAM/DamNotificationGroup.php · table dam_notification_groups (default) · traits HasFactory
Fillable: id, group_name, slug, created_at, updated_at
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
notification() | hasMany | DamNotification | notification_group_id, id | - |
DamSearchHistory ​
app/Models/DAM/DamSearchHistory.php · table dam_search_histories (default)
Fillable: id, workspace_id, user_id, terms, search_text, user_type, search_by, location, ip_address
Accessors: getUserAttribute
DamSystemNotifications ​
app/Models/DAM/DamSystemNotifications.php · table dam_system_notifications (default) · traits HasFactory
Fillable: id, user_id, workspace_id, sender_user_id, instance_id, notification_text, notification_url, read_at, created_at, updated_at
DamTile ​
app/Models/DAM/DamTile.php · table dam_tiles (default)
Fillable: id, workspace_id, instance_id, user_id, title, url, image, image_name, position, is_active, description
Casts: is_active → integer
Hidden: created_at, updated_at
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
workspace() | belongsTo | Workspace | workspace_id, id | - |
instance() | belongsTo | DamInstance | instance_id, id | - |
Accessors: getImageAttribute
DamUserNotifications ​
app/Models/DAM/DamUserNotifications.php · table dam_user_notifications (default) · traits HasFactory
Fillable: id, user_id, workspace_id, notification_id, is_email, is_system, created_at, updated_at
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
user() | belongsTo | User | user_id, id | - |
DealerUserInvitations ​
app/Models/DAM/DealerUserInvitations.php · table dealer_user_invitations (default)
Fillable: user_id, instance_id, token
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
user() | belongsTo | DealerUsers | user_id | - |
DealerUsers ​
app/Models/DAM/DealerUsers.php · table dealer_users (default) · extends Authenticatable · traits HasApiTokens, Notifiable, SoftDeletes
Fillable: id, dealer_id, instance_id, user_id, name, email, phone, profile_image, is_active, backend_login_user_id, is_backend_user, password, is_revoked, last_login
Hidden: password, deleted_at
Appends: display_thumb_profile_image
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
dealer() | belongsTo | Dealer | dealer_id | - |
instance() | belongsTo | DamInstance | instance_id | - |
damInstancesUsers() | hasManyThrough | DamInstance | DamInstancesUsers::class, user_id, id | - |
Accessors: getDisplayThumbProfileImageAttribute, getProfileImageAttribute
Other methods: shortName(), isPublicPortalAccount() (email equals DamInstance::PUBLIC_PORTAL_EMAIL; that account's password and profile cannot be changed from the portal)
DealerUsersActivity ​
app/Models/DAM/DealerUsersActivity.php · table dealer_users_activities (default)
Fillable: id, workspace_id, user_id, log_details, activity_url
DigitalAssets ​
app/Models/DAM/DigitalAssets.php · table digital_assets (default) · traits Searchable
Fillable: id, assets_version_id, version, workspace_id, user_id, file_name, display_file_name, file_type, file_size, height, width, terms_of_use, description, auto_tag, type, category_id, share_id, file_meta_data, thumbnail_file, compress_file, video_preview, acl_permission, is_public, visible_in_trashed, folder_permission, collection_permission, is_archive, archive_by, is_deleted, final_deleted, is_recent, is_editorial_use, file_preview_id, file_preview_status, modified_at, created_at, updated_at, watermark_file, watermark_original_file, visibility, is_external_upload
Casts: width → integer, height → integer
Hidden: visibility, instancePermissions
Appends: preview_image, collection, instance_visibility
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
damCollectionAssets() | hasMany | DamCollectionAssets | asset_id, id | - |
category() | belongsTo | DigitalAssetsCategory | category_id, id | ->select('id', 'folder_name', 'parent_id') |
user() | belongsTo | User | user_id, id | ->select('id', 'name', 'email', 'profile_image') |
archiveUser() | belongsTo | User | archive_by, id | ->select('id', 'name', 'email', 'profile_image') |
externalUser() | belongsTo | ExternalUser | user_id, id | ->select('id', 'name', 'email') |
tags() | hasMany | DigitalAssetsTag | assets_version_id, assets_version_id | - |
limited_tags() | hasMany | DigitalAssetsTag | assets_version_id, assets_version_id | ->where('vision_type', 'labels')->whereNotNull('tag_name') |
all_tags() | hasMany | DigitalAssetsTag | digital_assets_id, id | ->where('vision_type', 'labels')->whereNotNull('tag_name') |
workspace() | belongsTo | Workspace | workspace_id, id | - |
versions() | hasMany | AssetsVersion | asset_id | ->where('is_deleted', 0) |
acl() | hasMany | DamAcl | workspace_id, workspace_id | ->where('is_active', 1) |
assetsCustomFields() | hasMany | AssetsCustomField | asset_id | - |
assetProduct() | belongsTo | DamAssetProduct | id, asset_id | - |
instancePermissions() | morphMany | DamInstancePermission | permissionable | - |
Scopes: assetsByType, downloadAssetQry, collectionNameQry, excludeAdmin, customWhere, assetSizeQry, assetUserPermission, orderByMaxTag, instanceVisible
Accessors: getModifiedAtAttribute, getFileMetaDataAttribute, getDisplayFileAttribute, getPreviewImageAttribute, getEmailPreviewImageAttribute, getThumbnailFileAttribute, getVideoPreviewAttribute, getCompressFileAttribute, getCollectionAttribute, getShareIdAttribute, getAclPermissionAttribute, getWatermarkFileAttribute, getWatermarkOriginalFileAttribute, getInstanceVisibilityAttribute
Scout / Typesense: indexed through toSearchableArray(); collection schema in config/scout.php has fields id, workspace_id, instances_id, display_file_name, description, search_name, file_type, type, thumbnail_file, compress_file, video_preview, display_file, file_size, height, width, orientation, instance_visibility, is_external_upload, category_id, is_collection, collection_ids, created_by, created_by_id, created_at, modified_at, tags, custom_fields, custom_field_values, portal_custom_fields, portal_custom_field_values, breadcrumb. The indexed display_file (S3 key <url_slug>/digital_assets/<file_name>) is set only for file types gif, pdf, doc, docx, ppt, pptx, xlsx, xls, dotx, odt, ott, txt, svg and md (1ad517ad).
Other methods: getCachedInstanceId(), loadCategoryCache(), getTagsMapForAssets(), searchableCustomFieldValue(), getCustomFieldsMapForAssets(), getAssetsSearchCustomFields(), getAssetsCustomFields(), getAssetsCustomFieldsDealer(), getThumbnailSize(), getCompressSize(), normalizeImageColorToSrgb(), resizeAndEncodeWebp(), getTrendingOrRecentData(), getShareLinkData(), subCategoryIds(), getRequestedAssetsFilesSize(), subCategoryAssets(), addCategoryAssetsInZip(), generateFileFromVideo(), convertFile(), generateWatermarkFile(), filterMaxTagCount(), assetBreadcrumb()
Model events (booted): saving rejects a changed file_name that is not a plain file name, same rule as AssetsVersion. Conversion helpers now accept only a plain extension for the stored type and convert_type and shell-quote every argument, because both end up in a shell command.
DigitalAssetsCategory ​
app/Models/DAM/DigitalAssetsCategory.php · table digital_assets_categories (default) · traits SoftDeletes, Searchable
Fillable: workspace_id, user_id, parent_id, folder_name, description, category_path, integration_type, visible_in_trashed, permission_type, permission, group_id, final_deleted, created_at, updated_at, modified_at, visibility
Hidden: deleted_at, final_deleted, visible_in_trashed, visibility, instancePermissions
Appends: instance_visibility
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
subcategory() | hasMany | DigitalAssetsCategory | parent_id, id | ->with('subcategory') |
parent() | belongsTo | DigitalAssetsCategory | parent_id | ->with('parent') |
signleparent() | belongsTo | DigitalAssetsCategory | parent_id | ->with('parent') |
children() | hasMany | DigitalAssetsCategory | parent_id | - |
subCategories() | hasMany | DigitalAssetsCategory | parent_id, id | - |
assets() | hasMany | DigitalAssets | category_id, id | - |
instancePermissions() | morphMany | DamInstancePermission | permissionable | - |
Scopes: instanceVisible, userPermission
Accessors: getInstanceVisibilityAttribute
Scout / Typesense: indexed through toSearchableArray(); collection schema in config/scout.php has fields id, workspace_id, instances_id, parent_id, folder_name, search_name, description, breadcrumb, instance_visibility, created_at, modified_at.
Other methods: getCachedInstanceId(), getCategoryBreadcrumb(), addCategoryShareAssetsCount(), addCategoryAssetsInCount()
DigitalAssetsDownload ​
app/Models/DAM/DigitalAssetsDownload.php · table digital_assets_downloads (default)
Fillable: id, workspace_id, user_id, digital_assets_id, assets_version_id, share_id, collection_id, is_backend_download, download_by, asset_from, type, location, ip_address, zip_file_name
Accessors: getUserAttribute
DigitalAssetsTag ​
app/Models/DAM/DigitalAssetsTag.php · table digital_assets_tags (default) · traits Searchable
Fillable: workspace_id, user_id, digital_assets_id, tag_name, assets_version_id, search_tag_name
Hidden: created_at, updated_at
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
digitalAsset() | belongsTo | DigitalAssets | digital_assets_id | - |
Scopes: assetUserPermission
Scout / Typesense: indexed through toSearchableArray(); collection schema in config/scout.php has fields id, workspace_id, instances_id, tag_name, search_name, created_at.
Other methods: getCachedInstanceId()
ImportData ​
app/Models/DAM/ImportData.php · table import_data (default) · traits HasFactory
Fillable: id, workspace_id, user_id, sheet_name, category_name, category_id, sub_category_name, sub_category_id, asset_id, asset_name, asset_url, description, bf_attachment_id, bf_Asset_id, asset_tags, custom_fields, is_added_to_platform, note, migration_status, migration_result, attempts
Casts: migration_result → array
InstanceBanner ​
app/Models/DAM/InstanceBanner.php · table instance_banners (default) · traits SoftDeletes
Fillable: instance_id, title, position, image, image_name, url, description, is_active
Casts: is_active → integer
Hidden: deleted_at, created_at, updated_at
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
instance() | belongsTo | DamInstance | instance_id | - |
Accessors: getImageAttribute
ShareAssetsCategory ​
app/Models/DAM/ShareAssetsCategory.php · table share_assets_category · traits SoftDeletes
Fillable: id, workspace_id, instance_id, assets_id, category_id, collection_id, title, description, password, expiration, expires_at, expires_timezone, hide_download, share_origin, generated_source, generated_by, total_visited, is_active, created_at, updated_at
Hidden: password
Appends: front_url, password_required, share_url, user, is_expired
Casts: expires_at => datetime (stored in config('app.timezone'), serialised as UTC ISO)
Scopes: collectionNameQry, notExpired (expires_at after now(), or expires_at null and expiration null or TIMESTAMP(expiration, '23:59:59') after now()), expired (expires_at at or before now(), or expires_at null and TIMESTAMP(expiration, '23:59:59') at or before now()). The date-only branch was added so queries match is_expired. Both qualify the columns with the model table, so they work on joined queries.
Accessors: getShareUrlAttribute, getFrontUrlAttribute, getPasswordRequiredAttribute, getUserAttribute, getIsExpiredAttribute (true when resolvedExpiresAt() is at or before now())
Other methods: resolvedExpiresAt() returns expires_at, or for a row with only expiration the end of that date in the app time zone; static expiresAtFor(?string $date, string $timezone) returns the end of $date in $timezone converted to the app time zone, or null for an empty date; static expiryColumns(?string $date, string $timezone) returns ['expiration' => $date, 'expires_at' => expiresAtFor(...), 'expires_timezone' => $timezone], all null when there is no date (used by create and update). See Sharing: expiry.
Added in PR #453: isOpenFor($accessToken, $checkPassword = true) is true when the share is active, not expired and, if it has a password, $accessToken equals it (hash_equals); containsCategory($categoryId) is true when the folder is one of the share's folders or inside one (walks parent_id within the share's workspace); static idsBelongToWorkspace(array $assetIds, array $categoryIds, int $workspaceId) is true when every id is a positive integer naming an asset or folder of that workspace (uses whereIntegerInRaw so large shares stay under MySQL's placeholder limit). Share creation uses it to refuse foreign ids with 422 Some of the selected assets or folders are not available in this workspace.
SubscriptionAddon ​
app/Models/DAM/SubscriptionAddon.php · table subscription_addons · $timestamps = true · traits HasFactory
Fillable: name, slug, stripe_reference_id, group_name, billing_cycle, price, tokens, is_active, created_at, updated_at
Other methods: createAddonPlan()
SubscriptionUserActivity ​
app/Models/DAM/SubscriptionUserActivity.php · table subscription_user_activities (default)
Fillable: id, workspace_id, user_id, log_details, activity_performed_by, created_at, updated_at
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
users() | belongsTo | User | user_id, id | ->select('id', 'name', 'email', 'phone', 'default_workspace') |
SubscriptionUserAddon ​
app/Models/DAM/SubscriptionUserAddon.php · table subscription_user_addons · traits HasFactory, SoftDeletes
Fillable: subscription_addon_id , subscription_user_id, is_deleted, created_at, updated_at, deleted_at
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
subscription_addon() | belongsTo | SubscriptionAddon | subscription_addon_id, id | - |
SubscriptionUsers ​
app/Models/DAM/SubscriptionUsers.php · table subscription_users (default) · traits HasFactory
Fillable: id, user_id, workspace_id, stripe_customer_id, stripe_payment_id, stripe_subscription_id, subscription_id, features, coupon_id, payment_status, payment_status_alias, billing_cycle, price, discount, pay_amount, payment_type, is_active, is_existing_user, start_date, cancel_reason, cancel_comment, status, next_billing_date, next_subscription_id, dashboard_walkthrough, is_backoffice_user, payment_link, payment_pause, created_at, updated_at, trial_days, trial_end_date, is_trial_account, trial_expire, is_suspended, openai_image_count, email_send_number, email_flag
Dates: created_at
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
users() | belongsTo | User | user_id, id | ->select('id', 'name', 'email', 'phone', 'default_workspace', 'timezone', 'last_name') |
subscription() | belongsTo | Subscriptions | subscription_id | - |
inquiry() | belongsTo | DamInquiry | stripe_customer_id, stripe_customer_id | - |
totalStorage() | hasMany | AssetsVersion | workspace_id, workspace_id | ->where("final_deleted", 0) |
Scopes: listedActive
Accessors: getFeaturesAttribute
Other methods: getPaymentStatus()
Subscriptions ​
app/Models/DAM/Subscriptions.php · table subscriptions (default) · traits HasFactory
Fillable: name, slug, stripe_reference_id, group_name, type, billing_cycle, price, features, is_active, created_at, updated_at
| Relation | Type | Related | Keys | Constraints |
|---|---|---|---|---|
subscriptionUsers() | hasMany | SubscriptionUsers | subscription_id, id | - |
Accessors: getFeaturesAttribute
Mutators: setFeaturesAttribute
Other methods: createStripePlan()
TransactionActivity ​
app/Models/DAM/TransactionActivity.php · table transaction_activities (default) · traits HasFactory
Fillable: id, transaction_number, workspace_id, instance_id, asset_id, version_id, collection_id, category_id, share_id, user_id, event, sub_event, environment, system_data, city, state, country_code, ipv4, postal, country_name
Static methods: recordAgentEvent(Request $request, int $workspaceId, string $event, string $subEvent, array $ids = []) (since 8d907a3). Writes one row with environment = 'agent', user_id from the token, system_data {"client": "<marker>"}, ipv4 and transaction_number = highest + 1; no geo columns. environment values are admin, dealer, external, anonymous and agent. See Agent (MCP) requests in analytics.
WorkspaceRestructureData ​
app/Models/DAM/WorkspaceRestructureData.php · table workspace_restructure_data
Fillable: workspace_id, sheet_name, batch_id, asset_id, current_folder_id, target_folder_id, current_asset_name, new_asset_name, status, is_folder_changed, is_name_changed, note, processed_at
Casts: batch_id → integer, asset_id → integer, current_folder_id → integer, target_folder_id → integer, is_folder_changed → boolean, is_name_changed → boolean, processed_at → datetime