Skip to content

Backend API ​

Overview ​

The Backend-API is the Laravel application behind Collage. Its README describes it as the backend for the DAM "including Admin, Backoffice, Support & Dealer Portal". It serves the admin app (app.collage.inc), the brand portal, partner integrations, and a small server-rendered back-office.

ItemValue (from composer.json)
Frameworklaravel/framework ^11.21
PHP^8.2.0
App structureLaravel 11 framework, but the older application skeleton: app/Http/Kernel.php, app/Console/Kernel.php, App\Providers\RouteServiceProvider and a providers array in config/app.php (no bootstrap/providers.php)
Source snapshotorigin/development at f517b6b

See Architecture for how a request moves through the app, and Setup to run it locally.

API surfaces ​

All route files are registered in App\Providers\RouteServiceProvider::boot(). The api middleware group is defined in app/Http/Kernel.php (LogApiRequests, throttle:api, SubstituteBindings).

Route fileURL prefixMiddleware groupMain guardAudienceDocs
(inline) GET /healthnonenonenoneLoad balancers and monitors (HealthController@index)Architecture
routes/api.php/api (routes inside add /v1)apiauth:api (Passport, users)Admin app (workspace members) and external uploaders (external-user via check.external)Admin API
routes/dam-api.php/dam (routes inside add /v1)apiauth:dam-api + dam-api (Passport, dealer_users)Brand portal usersPortal API
routes/external-api.php/external (routes inside add /v1)apiauth:external-api + external-api (Passport, external_app)Third-party apps using an External Api TokenExternal API
routes/web.phpnone (/admin/* for the back-office)websession (web guard)Internal back-office and /status pageWeb routes
routes/channels.php/broadcasting/authauth:apiapiPrivate broadcast channelsEvents
routes/console.phpn/an/an/aClosure commands (only inspire)Console commands

routes/web2.php exists in the repository but is not loaded by RouteServiceProvider.

Tech stack ​

Key packages from composer.json require:

AreaPackageVersion
API auth (OAuth2 tokens)laravel/passport^12.3.0
Token auth (installed, EnsureFrontendRequestsAreStateful is commented out of the api group)laravel/sanctum^4.0.0
Social loginlaravel/socialite, socialiteproviders/microsoft^5.15, ^4.7
Passkeyslaragear/webauthn^4.1
Enterprise SSO (SAML 2.0)onelogin/php-saml^4.2
Searchlaravel/scout, typesense/typesense-php^10.11, ^4.9
API docsdarkaonline/l5-swagger^8.6
Excel import/exportmaatwebsite/excel^3.1
PDFbarryvdh/laravel-dompdf^3.0
Storageaws/aws-sdk-php, league/flysystem-aws-s3-v3, platformcommunity/bunnycdn-storage^3.321, ^3.28, ^0.2.0
Imagesintervention/image-laravel*
File previewsfilepreviews/filepreviews^1.0
AI tagging (Google Vision)yedincisenol/vision^0.1.2
Paymentsstripe/stripe-php^15.8
Broadcastingpusher/pusher-php-server^7.2
Queuespda/pheanstalk (beanstalkd driver)^4.0
Logging to BigQuerygoogle/cloud-bigquery^1.28
Backupsspatie/laravel-backup^8.8
Integrationsspatie/dropbox-api, asana/asana, ajimix/asana-api-php-class^1.22, ^0.10.8, ^6.5
Mail in / Slack outwebklex/laravel-imap, laravel/slack-notification-channel^6.2, ^3.3
Geo / browserstevebauman/location, hisorange/browser-detect^7.3.2, ^5.0
Recurrencerlanvin/php-rrule, simshaun/recurr^2.5, ^5.0
Miscsimplesoftwareio/simple-qrcode, forxer/laravel-gravatar, axlon/laravel-postal-code-validation, matriphe/larinfo, doctrine/dbal, guzzlehttp/guzzle

Dev packages include phpunit/phpunit ^11.3.1, laravel/sail, kitloong/laravel-migrations-generator and spatie/laravel-ignition.

Folder map of app/ ​

Counts are PHP files, including subfolders.

FolderFilesWhat lives there
Http/Controllers64Api/v1 (admin app), DAM/v1 (brand portal and external API), Web (back-office), EmailControl, HealthController
Http/Middleware24See Middleware
Http/Requests6Form requests
Http/Resources9API resources
Models15833 at the root, DAM (47), LM (74), EmailControl (3), Project (1)
Console82Kernel.php (the schedule) and 81 commands
Jobs27Queued jobs: DAM (22), Import (1), root (4)
Mail57Mailables: DAM (45), BackOffice (2), root (10)
Exports20Excel exports (reports, leads, dealerships)
Imports6Excel imports (leads, dealerships, products)
Services12BigQueryLog, DAM, Sso, WorkspaceMailService
Events7Broadcast and domain events
Listeners3Event listeners
Providers12Service providers
Logging2CreateWeeklyLog, ImportMigrationLogger
Support3Support classes
Casts2CustomFieldOptions, FlexibleJson
RestResource2RestResponse and its facade
ProjectActivity, WorkSpaceActivity, PushNotification, ZipCode2 eachSmall services bound in the container with a facade
Helpers1Helper.php, autoloaded through composer.json files
Traits2ResolvesViewerTimezone, ResumeHoldLMInvitationEmail
Exceptions, Permissions, WebAuthn1 eachException handler, permissions, CacheChallengeRepository

Section map ​

PageCovers
ArchitectureRequest lifecycle, guards, queues, storage, caching, logging, schedule, providers
SetupLocal install, artisan commands, env variable names
ConfigurationEvery file in config/ and the custom config files
MiddlewareEvery middleware class, alias and where it is used
RoutesRoute overview
Admin APIroutes/api.php
Portal APIroutes/dam-api.php
External APIroutes/external-api.php
Web routesroutes/web.php
ControllersController inventory
ModelsModel overview
DAM modelsapp/Models/DAM
LM modelsapp/Models/LM
Core modelsRoot models (User, Workspace, ...)
JobsQueued jobs
Console commandsArtisan commands and the schedule
MailMailables
EventsEvents, listeners and broadcast channels
Servicesapp/Services and container bindings
Exports and importsExcel exports and imports
Resources and requestsAPI resources and form requests
FeaturesFeature walkthroughs
AuthenticationLogin, social, passkeys, SSO
AssetsUpload, versions, previews
DatabaseConnections, tables, ER diagrams, relationships
FoldersFolder tree, move, trash and restore
CollagesCollages and their assets
Permissions and Portal VisibilityRoles, ACL and per-portal visibility
SearchScout and Typesense
SharingShare links
PortalsBrand portals
SubscriptionPlans, storage, Stripe
NotificationsEmail and system notifications