01 · Configure the form
Admin defines form title, sections, fields, options, validation and data-source rules.
Example form definition
Generated request payload
{
"title": "Incident Report",
"sections": [{
"title": "Incident Details",
"fields": [{
"field_key": "incident_date",
"field_label": "Incident date",
"field_type": "date",
"is_required": true
}]
}]
}
Database write / SQL plan
BEGIN; INSERT INTO sw_cmms_hse_master_incident_form (...); INSERT INTO sw_cmms_hse_master_incident_form_section (...); INSERT INTO sw_cmms_hse_master_incident_form_field (...); COMMIT;
Illustrative SQL only. In production, use parameterized Laravel queries/Eloquent and a transaction.