Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"illuminate/filesystem": "^12.0 || ^13.0",
"illuminate/http": "^12.0 || ^13.0",
"illuminate/support": "^12.0 || ^13.0",
"illuminate/validation": "^12.0 || ^13.0"
"illuminate/validation": "^12.0 || ^13.0",
"mews/purifier": "^3.4"
},
"require-dev": {
"orchestra/testbench": "^10.0 || ^11.0",
Expand Down
141 changes: 140 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions config/formforge.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@
'key' => env('FORMFORGE_HTTP_FILE_URL_KEY', 'url'),
],
],
'public_link' => [
'resolver' => \EvanSchleret\FormForge\Support\DefaultFormPublicLinkResolver::class,
'base_url' => env('FORMFORGE_HTTP_PUBLIC_LINK_BASE_URL', null),
],
'idempotency' => [
'ttl_minutes' => env('FORMFORGE_HTTP_IDEMPOTENCY_TTL', 1440),
],
Expand Down
10 changes: 10 additions & 0 deletions lang/en/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
'route_param_required' => 'Route parameter [:name] is required.',
'route_param_numeric' => 'Route parameter [:name] must be numeric.',
'form_not_published' => 'This form is not published yet.',
'form_not_available_yet' => 'This form is not available yet.',
'form_paused' => 'This form is paused.',
'form_response_limit_reached' => 'This form is closed.',
'form_submission_code_invalid' => 'The submission code is invalid.',
'resolve_form_schema_not_found' => 'Form schema not found.',
'field_required' => 'The field field is required.',
'upload_staged_mode_required' => 'Upload staging endpoint requires uploads.mode=staged.',
Expand Down Expand Up @@ -51,4 +55,10 @@
'privacy_action_unsupported' => 'Unsupported GDPR action [:action]. Allowed values: none, anonymize, delete.',
'privacy_after_days_numeric' => 'GDPR [after_days] must be numeric or null.',
'privacy_after_days_min' => 'GDPR [after_days] must be greater than or equal to 0.',
'address_line1' => 'Address line 1',
'address_line2' => 'Address line 2',
'address_city' => 'City',
'address_state' => 'State',
'address_zip' => 'Zip',
'address_country' => 'Country',
];
1 change: 1 addition & 0 deletions lang/en/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
'unknown_field_identifier' => 'Unknown field identifier.',
'unknown_fields' => 'Payload contains unknown fields: :fields.',
'conflicting_payload_keys' => 'Payload contains conflicting field keys: :keys.',
'field_validation_failed' => 'The value does not satisfy the validation rules.',
'form_not_found' => 'Form [:key] was not found.',
'form_version_not_found' => 'Form [:key] with version [:version] was not found.',
'immutable_version' => 'Form [:key] version [:version] is immutable and cannot be changed.',
Expand Down
10 changes: 10 additions & 0 deletions lang/fr/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
'route_param_required' => 'Le paramètre de route [:name] est requis.',
'route_param_numeric' => 'Le paramètre de route [:name] doit être numérique.',
'form_not_published' => 'Ce formulaire n’est pas encore publié.',
'form_not_available_yet' => 'Ce formulaire n’est pas encore disponible.',
'form_paused' => 'Ce formulaire est en pause.',
'form_response_limit_reached' => 'Ce formulaire est fermé.',
'form_submission_code_invalid' => 'Le code de soumission est invalide.',
'resolve_form_schema_not_found' => 'Schéma du formulaire introuvable.',
'field_required' => 'Le champ field est requis.',
'upload_staged_mode_required' => 'Le point de terminaison de staging upload requiert uploads.mode=staged.',
Expand Down Expand Up @@ -51,4 +55,10 @@
'privacy_action_unsupported' => 'Action RGPD non supportée [:action]. Valeurs autorisées : none, anonymize, delete.',
'privacy_after_days_numeric' => 'RGPD [after_days] doit être numérique ou null.',
'privacy_after_days_min' => 'RGPD [after_days] doit être supérieur ou égal à 0.',
'address_line1' => "Ligne d'adresse 1",
'address_line2' => "Ligne d'adresse 2",
'address_city' => 'Ville',
'address_state' => 'État',
'address_zip' => 'Code postal',
'address_country' => 'Pays',
];
1 change: 1 addition & 0 deletions lang/fr/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
'unknown_field_identifier' => 'Identifiant de champ inconnu.',
'unknown_fields' => 'La charge utile contient des champs inconnus : :fields.',
'conflicting_payload_keys' => 'La charge utile contient des clés de champs en conflit : :keys.',
'field_validation_failed' => 'La valeur ne respecte pas les règles de validation.',
'form_not_found' => 'Le formulaire [:key] est introuvable.',
'form_version_not_found' => 'Le formulaire [:key] avec la version [:version] est introuvable.',
'immutable_version' => 'Le formulaire [:key] version [:version] est immuable et ne peut pas être modifié.',
Expand Down
11 changes: 10 additions & 1 deletion src/Definition/ApiBlueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ public function toArray(): array
private function normalizeConfig(array $config): array
{
$normalized = [];
$knownEndpoints = ['schema', 'submission', 'upload'];

foreach (['schema', 'submission', 'upload'] as $endpoint) {
foreach ($knownEndpoints as $endpoint) {
$endpointConfig = $config[$endpoint] ?? [];

if (! is_array($endpointConfig)) {
Expand Down Expand Up @@ -142,6 +143,14 @@ private function normalizeConfig(array $config): array
}
}

foreach ($config as $key => $value) {
if (in_array($key, $knownEndpoints, true)) {
continue;
}

$normalized[$key] = $value;
}

return $normalized;
}

Expand Down
Loading