Skip to content

Controllers ​

Overview ​

All HTTP controllers live under app/Http/Controllers. There are 64 controller files (including the base Controller). Each one extends App\Http\Controllers\Controller.

The folders map to the route files:

FolderUsed byClients
Api/v1/*routes/api.php (Admin API)Collage Admin. TransactionActivityController and ZipLinkController are also used by routes/dam-api.php.
DAM/v1/Auth, DAM/v1/Digitalroutes/dam-api.php (Portal API)Brand Portal
DAM/v1/Externalroutes/external-api.php (External API)Customer integrations
Web, Web/Subscriptionroutes/web.php (Web)Internal super-admin panel (Blade)
EmailControlnoneNot routed

Columns:

  • Public methods: public function declarations, excluding __construct. Public helpers that no route uses count too, so this is often higher than Routed methods.
  • Routed methods: distinct methods that at least one route points to. "+N missing" means a route points to a method that does not exist in the class.
  • Lines: file length, as a rough size guide.

Common patterns across API controllers, read from source:

  • Methods wrap their body in try/catch and return App\RestResource\RestResponse (success, warning, validationError, error). error() hides the exception message in production.
  • Validation is inline (Validator::make($request->all(), [...])), not FormRequests. The only FormRequests used by routed methods are the WebAuthn requests in PasskeyController (AssertionRequest, AttestationRequest, AttestedRequest).
  • The workspace is looked up from url_workspace_id or workspace_id (the url_slug) on each call; Admin methods then call DamInstance::checkUser($request, $workspaceId) for the DAM role check.
  • Controllers talk to Eloquent models directly; heavier work is pushed to jobs (for example GenerateVideoPreviewJob, ConvertAssetsJob, SendDamEmailSystemNotificationJob) and services under App\Services. See Architecture.

Root ​

Namespace App\Http\Controllers.

ClassPublic methodsRouted methodsRoute filesLinesResponsibility
Controller8--188Base class for every controller. Adds the standard Laravel traits and a few shared helpers (see below).
HealthController11RouteServiceProvider91GET /health status check (database, search, queue, worker, storage, cache). Registered in RouteServiceProvider, not in a route file.

Api/v1 ​

Namespace App\Http\Controllers\Api\v1.

ClassPublic methodsRouted methodsRoute filesLinesResponsibility
FeedbackController11Admin API58Sends product feedback email.
TransactionActivityController65Admin API, Portal API794Activity logging (views, downloads, shares) from Admin, Brand Portal and share links. Payloads arrive encoded.
WebhookController11Admin API104Receives file-preview processing webhooks.
ZipLinkController44Admin API, Portal API481Builds encoded ZIP manifests (file lists) for bulk downloads from Admin, Brand Portal and share links.

Api/v1/Auth ​

Namespace App\Http\Controllers\Api\v1\Auth.

ClassPublic methodsRouted methodsRoute filesLinesResponsibility
AuthController1514Admin API1043Admin login, registration, password reset, invited-user passwords, current user, branding, logout.
PasskeyController66Admin API150Passkey (WebAuthn) login and passkey management.
SocialAuthController42Admin API118Social login redirect and callback.
SsoAuthController44Admin API240SAML sign-in: resolve by email, redirect, ACS and SP metadata.
TokenVerifyController11Admin API147verify: lightweight token check for server-side callers; returns user_id, is_external and workspaces with the DAM role (added in 6ac8a4f).

Api/v1/Support ​

Namespace App\Http\Controllers\Api\v1\Support.

ClassPublic methodsRouted methodsRoute filesLinesResponsibility
AuthController33Admin API197Support-staff login into a workspace and support token termination.

Api/v1/User ​

Namespace App\Http\Controllers\Api\v1\User.

ClassPublic methodsRouted methodsRoute filesLinesResponsibility
ExternalUserController1212Admin API815External (upload-only) users: OTP login, upload, ZIP preview thumbnail, upload request, and admin management.
UsersController2120Admin API1796Workspace users: profile, invitations, roles and permissions, activation, passwords, support PIN.

Api/v1/Workspace ​

Namespace App\Http\Controllers\Api\v1\Workspace.

ClassPublic methodsRouted methodsRoute filesLinesResponsibility
SsoSettingsController55Admin API423Enterprise SSO (SAML) connection settings, metadata sync, test and sign-in activity.
WorkspaceController1514Admin API1082Workspace creation, settings, custom domain, logo/favicon, branding, invitations, ownership.

Api/v1/Announcement ​

Namespace App\Http\Controllers\Api\v1\Announcement.

ClassPublic methodsRouted methodsRoute filesLinesResponsibility
AnnouncementController99Admin API585Announcements: CRUD for admins and read state for recipients.

Namespace App\Http\Controllers\Api\v1\Search.

ClassPublic methodsRouted methodsRoute filesLinesResponsibility
SearchController44Admin API396Admin search and recent searches.

Api/v1/NewDashboard ​

Namespace App\Http\Controllers\Api\v1\NewDashboard.

ClassPublic methodsRouted methodsRoute filesLinesResponsibility
NewDashboardController94Admin API602Admin dashboard widgets: recent uploads, Collages, folders, weekly insights.

Api/v1/DigitalAssets ​

Namespace App\Http\Controllers\Api\v1\DigitalAssets.

ClassPublic methodsRouted methodsRoute filesLinesResponsibility
ACLController55Admin API182ACL role CRUD and ordering.
AnalyticsController22Admin API160Storage analytics and the storage analytics email.
AssetController3125Admin API3080Asset upload, versions, move/copy, metadata updates, ACL, archive/delete, conversion, embed codes, asset analytics.
CategoryController1915Admin API2399Folders: create, rename, list, browse with assets, counts, trash and restore.
CustomFieldController1111Admin API828Custom field definitions and per-asset custom field values.
DamCollectionController1111Admin API1305Collages: CRUD, asset membership, select-all, share links.
DamInstanceController1817Admin API1342Brand Portals: CRUD, visibility, settings, portal users and invitations, user activity.
DamNotificationController88Admin API413Workspace and user notification settings, in-app system notifications.
DamPermissionController22Admin API496Portal visibility of assets, folders and Collages (single and bulk).
DamTilesController66Admin API282Brand Portal tiles and slider configuration.
DashboardController44Admin API209Admin dashboard common data, download history, third-party app token.
DealerController1212Admin API592Dealers and dealer users (single and bulk).
InstanceBannerController55Admin API280Brand Portal banners and ordering.
ShareAssetsController1611Admin API1311Share links: create, list, update, delete, and the public share page endpoints.
SubscriptionController1716 (+1 missing)Admin API848Workspace subscription: plan details, Stripe activation, cards, cancel/reactivate, add-ons, trial, data deletion.
TagController66Admin API599Asset tags: add/remove in bulk, common, suggested and workspace tag lists.

DAM/v1/Auth ​

Namespace App\Http\Controllers\DAM\v1\Auth.

ClassPublic methodsRouted methodsRoute filesLinesResponsibility
AuthController1111Portal API536Brand Portal login (including Admin-to-portal jump), password reset, invitations, current user, logout.

DAM/v1/Digital ​

Namespace App\Http\Controllers\DAM\v1\Digital.

ClassPublic methodsRouted methodsRoute filesLinesResponsibility
AnnouncementController55Portal API186Announcement notifications for portal users.
AssetController1914Portal API1443Portal asset browsing, detail, search, recent searches, view/download counts, conversion.
AssetProductCartController55Portal API235Portal store cart.
AssetProductController11Portal API55Portal store product list.
AssetProductOrderController138Portal API573Portal store orders: place, list, detail, summary, cancel.
CategoryController117Portal API637Portal folder browsing, counts, breadcrumbs, asset metadata.
DamCollectionController54Portal API360Portal Collages and Collage share links.
DamUserAddressController55Portal API199Saved addresses for portal store orders.
DashboardController1814 (+1 missing)Portal API1693Portal home data, tiles, banners, search, downloads, domain check, profile update, feedback.
NotificationController22Portal API73Portal order status alerts.
PDFController11Portal API88Invoice PDF for a portal store order.
ShareAssetsController98Portal API709Portal share links and the portal share page endpoints.

DAM/v1/External ​

Namespace App\Http\Controllers\DAM\v1\External.

ClassPublic methodsRouted methodsRoute filesLinesResponsibility
AssetsController1411External API891External integration API: folders, assets, search, downloads, embed codes, tags, thumbnails.
AuthController21External API40External API login with app key and secret.

Web ​

Namespace App\Http\Controllers\Web.

ClassPublic methodsRouted methodsRoute filesLinesResponsibility
AdminController1917Web590Super-admin panel: session login, workspace list and detail, analytics dashboard, workspace modules, project status colours.
AdminUsersController43Web330Super-admin list of workspace users and Brand Portal users across all workspaces.
MauticController2320Web547Super-admin Mautic/SharpSpring account, form and field mapping per workspace.
OperationsController33Web384Super-admin page that runs whitelisted Artisan commands (reports and similar) and shows their status.
StatusController44Web296JSON status at / and the password-gated /status page.
UrlSharingController50-129Old URL sharing and S3 bucket helpers. Its routes in web.php are commented out.

Web/Subscription ​

Namespace App\Http\Controllers\Web\Subscription.

ClassPublic methodsRouted methodsRoute filesLinesResponsibility
CouponController11Web12Super-admin coupon list page.
InquiryController44Web170Super-admin subscription inquiries: list, export, quick notes.
InvoiceController54Web165Super-admin Stripe invoice list and search.
PlanController55Web266Super-admin subscription plan CRUD.
SubscriptionAddOnController66Web137Super-admin subscription add-on CRUD and status.
SubscriptionController2220Web843Plan selection, Stripe pay links, checkout completion, trial creation, plan changes and cancellation.
UserController2323 (+1 missing)Web1222Super-admin view of subscribed workspaces: status, invoices, limits, trial days, white label, SSO, mail settings, data deletion.

EmailControl ​

Namespace App\Http\Controllers\EmailControl.

ClassPublic methodsRouted methodsRoute filesLinesResponsibility
EmailManageController90-506Email permission and email setting management by role/user, plus a sendEmail helper. No route points to it.
EmailModuleController40-88CRUD for email modules. No route points to it.

Base Controller ​

App\Http\Controllers\Controller extends Illuminate\Routing\Controller and uses the three standard traits:

TraitGives
AuthorizesRequests$this->authorize() and policy helpers
DispatchesJobs$this->dispatch()
ValidatesRequests$this->validate()

It also carries the swagger-php header (@OA\Info title "Collage api", and an access_token bearer security scheme) that the @OA annotations in the API controllers build on.

Shared public helpers on the base class:

MethodWhat it does
findDistance($zipOne, $zipTwo)Cached zip-to-zip distance from ZipcodeDistance; falls back to findGoogleDistance and stores the result.
findGoogleDistance($zipOne, $zipTwo)Calls the Google Distance Matrix API. The key comes from GOOGLE_KEY, with a hard-coded fallback key in the source that should be removed.
updateLeadLastActivity($leadId)Touches updated_at on an LM\Lead.
updateDealershipLastActivity($dealershipId)Touches updated_at on an LM\Dealership.
damAssetOrderNumberGenerate($workspaceId)Next store order number from DamAssetOrderSetting (automatic or workspace-defined).
checkDamAssetOrderNumberGenerate($orderNumber, $workspaceId)Recursively bumps the order number until it is unused.
damAssetSKUNumberGenerate($workspaceName, $workspaceId, $userId, $assetId)SKU for a store product, with optional prefix/suffix abbreviation.
checkDamAssetSKUNumberGenerate($skuNumber, $workspaceId)Recursively bumps the SKU until it is unused.

The zip-distance and lead/dealership helpers belong to the older LM (lead management) module.

Traits used by controllers ​

Two project traits are used by controllers:

TraitUsed byPurpose
App\Traits\ResolvesViewerTimezoneNewDashboard\NewDashboardController, DigitalAssets\AssetController, DigitalAssets\ShareAssetsController, DigitalAssets\DamCollectionControllerConverts analytics day buckets from the user's profile timezone to the app timezone; turns a share link's expiration date into an expires_at instant in the creator's zone; rewrites modified_at on share pages into the visitor's X-Timezone zone. See Services: viewer timezone.
App\Traits\ResumeHoldLMInvitationEmailEmailControl\EmailManageController (not routed)Holds and resumes LM invitation emails.

All other controllers rely only on the base class traits above.

Controllers with no route ​

  • EmailControl\EmailManageController and EmailControl\EmailModuleController: no route file or class references them.
  • Web\UrlSharingController: its four routes are commented out in routes/web.php.
  • HealthController is routed, but from RouteServiceProvider (GET /health), not from a route file.