Appearance
Exports and Imports ​
Overview ​
app/Exports and app/Imports hold maatwebsite/excel (^3.1) classes. Only four export classes are used today, all for reports: the monthly workspace report, the weekly platform report, the workspace asset report, and the back-office inquiry list. The other exports and every import class come from the older lead-management (LM) and order modules and are not instantiated anywhere in app/ or routes/.
The current asset import (CSV to platform) does not use these classes. It runs through app/Jobs/Import/ProcessAssetImportJob.php and the commands under app/Console/Commands/Import, and writes its audit trail with App\Logging\ImportMigrationLogger (see Services).
Exports in use ​
| Class | Output | Triggered by | Delivery |
|---|---|---|---|
MonthlyWorkspaceReportExport | XLSX with 6 sheets | send:monthly-workspace-reports (MonthlyWorkspaceReports), scheduled monthlyOn(1, '09:00') America/Denver; also from the back-office operations panel | Excel::raw(...) attached by SendMonthlyWorkspaceReportEmail as monthly_workspace_report_{suffix}.xlsx |
WeeklyPlatformReportExport | XLSX with 2 sheets | send:weekly-platform-report (SendWeeklyPlatformReport, options --startDate, --endDate), scheduled weekly()->mondays()->at('09:00') America/Denver; also from the operations panel | Attached by SendWeeklyPlatformReportEmail as weekly_platform_report.xlsx |
WorkspaceAssetReportExport | XLSX, one sheet | dam:export-asset-report (ExportWorkspaceAssetReport, options --workspace slug, --email, --memory), run by hand or from the operations panel | Excel::raw(...) attached by SendAssetReportEmail as {slug}_asset_report_{Ymd_His}.xlsx |
InquiriesExport | XLSX or other extension stored on the Inquiry disk (public/upload/inquiry) | GET /admin/subscription/export (Web/Subscription/InquiryController@export), back-office | Returns RestResponse::success with filename = config('app.export_url') + upload/inquiry/{file} |
The operations panel is Web/OperationsController (GET /admin/operations, POST /admin/operations/run, GET /admin/operations/status). It maps form fields to the command options listed above.
Report flow ​
Recipients:
- Monthly report: the workspace
user_email, with a hard-coded BCC list, for each id in the command's hard-coded$workspaceIds(or only--workspace={id}).--emailsends to that address only, without BCC.--from/--to(YYYY-MM) choose the period,--splitsends one report per month; legacy--month,--year,--end-monthstill work. - Weekly platform report: a hard-coded
$emailslist in the command. Default period is the previous Monday to Sunday. - Asset report: the
--emailaddress (prompted when run interactively, with a confirmation).
MonthlyWorkspaceReportExport ​
WithMultipleSheets. Takes one array (assets_data, folder_data, collage_data, share_data, user_data, date_data, workspace_name); a missing key becomes an empty sheet. All sheets except Share use the WithBoldHeaderRow trait (bold row 1, left aligned); Share does the same in its own registerEvents().
| Sheet class | Title | Columns |
|---|---|---|
MonthlyWorkspaceReportAssetsSheet | Assets Data | Asset ID, Name, Viewed, Downloaded, Shared, Other Event |
MonthlyWorkspaceReportFolderSheet | Folder Data | Category ID, Folder Name, Viewed, Downloaded, Shared, Other Event |
MonthlyWorkspaceReportCollageSheet | Collage Data | Collection ID, Collage Name, Viewed, Downloaded, Shared, Other Event |
MonthlyWorkspaceReportShareSheet | Share Data | Share ID, Share URL, View Count, Downloaded Count, Asset IDs |
MonthlyWorkspaceReportUserSheet | User Data | User ID, User Name, Type, Event Breakdown, IDs |
MonthlyWorkspaceReportDateSheet | Date Data | Activity Date, User Name, Environment, Event, Total Events, Asset IDs, Collection IDs, Category IDs, Share IDs |
Share URL is built as {share_origin or DAM_FRONTEND_URL}/[{workspace-name-slug}/]shared-assets/{base64 share_id}?status={base64 'collection' or 'multiple'}; the workspace segment is added only when generated_source is admin. Column B gets an "Open link" hyperlink. User Data "Event Breakdown" is {event_key}({event_count}), and "IDs" picks asset, collection or category ids from the event key prefix.
WeeklyPlatformReportExport ​
WithMultipleSheets, constructed with two collections from transaction_activities.
| Sheet class | Title | Columns |
|---|---|---|
WeeklyPlatformReportSheet1 | Activity Details | Date, Workspace ID, Workspace Name, Environment, User ID, User Name, Event Breakdown, Total Events |
WeeklyPlatformReportSheet2 | User Summary | Date, Workspace ID, Workspace Name, Admin Users Count, Admin User Names, Dealer Users Count, Dealer User Names, External Users Count, External User Names |
WorkspaceAssetReportExport ​
FromArray, WithHeadings, WithTitle (Asset Report), WithEvents. Columns:
asset_id, display_file_name, file_type, file_size, width, height, category_id, category_path, tags, custom_field_values, instance_visibility, collection_ids, asset_url, compress_file_url, modified_at, created_at, created_by_id, description.
asset_url and compress_file_url are S3 pre-signed URLs valid for 7 days (temporaryUrl, the SigV4 maximum) and are rendered as underlined hyperlinks. Row data is read with raw SQL from digital_assets, digital_assets_tags, dam_collection_assets, dam_instance_permissions and a recursive digital_assets_categories path query.
InquiriesExport ​
FromCollection, WithHeadings, WithColumnFormatting (column E, Phone, formatted as 0). Columns: Created Date, User Name, Email, Company Name, Phone, Payment Status, Requested Plan, Inquiry Status. The controller picks the date range from type (week, month, quarter, year, semi-month) or start_date / end_date.
Exports not referenced ​
Each takes an array $excelData and returns it as the collection (FromCollection, WithHeadings, Exportable). No caller exists in app/ or routes/.
| Class | Columns |
|---|---|
DamAseestOrderExport | Id, Name, Email, Total Items, Total Amount, Order Date, Status |
DamImagesExport | Name, Url |
DealershipExport | Sr. no, Name, Primary contact, Primary contact role, Email, Phone, City, Country, Assign leads, Last activity, Category, RSM, Products |
LeadAnalyticsReportExport | Name, Email, Created Date, Dealership Name, Product Name, Status Name |
LeadExport | Sr. no, Name, Email, Phone, Address, Form title, Lead source, Lead score, Lead date, Last activity, Product name, Category, Dealership name, RSM name, Variation name, Variation value |
RsmLeadExport | Id, Name, Email, Phone, Product Name, Category, Dealership, RSM, Variation Name, Variation Value, Lead Source, Lead Score, Created Date, Updated Date, Status |
RsmUserList | ID, RSM Name, RSM Email, RSM Phone, Assigned Leads, Associated Dealerships, Associated Products |
Imports ​
All six classes use ToCollection and WithHeadingRow (so row keys are the snake-cased heading names). None is referenced from app/ or routes/; they belong to the LM module.
| Class | Target | Expected columns / mapping | Notes |
|---|---|---|---|
DealershipImport | LM\Dealership | email, dealership_name, address, phone, country, state, city, zip | Constructor ($workspaceId, $user, $userId); generates dealership_number |
DealershipImportWithMapping | LM\Dealership | email plus a user mapping list of {databaseColumn, sheetColumn} | Chunk and batch size 150. Skips existing emails in the workspace. zip_code goes through ZipCode::sanitize2 and findAddressFromZipRadar and fills lat, lon, open_street_map_address, city, state, country, address_line_1 |
LeadImport | LM\Lead | email, first_name, last_name, phone_number, street, city, country, state, zipcode, lead_score, form_name, sharpspring_id, is_qualified, lead_create_date, lead_last_activity_date | Skips existing leads; sets lead_source Web, is_import 1. Product, dealership and distance logic is commented out |
LeadImportOld | LM\Lead | Same as LeadImport without lead_score | Older copy; updates created_at, updated_at, is_qualify on existing leads |
LeadImportWithMapping | LM\Lead | email plus a mapping list | Chunk and batch size 150. Converts created_at from America/Denver to UTC when the sheet has SharpSpring ids; geocodes zip_code with Radar; calls createImportLeadEvent() after each insert; calls gravatar() for the email |
ProductImportWithMapping | LM\Product and LM\ProductAlias | product_name, category_id plus a mapping list | Chunk and batch size 150. Validates the category, skips existing products, splits product_aliases on commas and inserts new ProductAlias rows; drops product_image |