HTTP API
Resources, Models, and Controller Overrides
Serialization customization and extension points.
Resource customization
Config keys:
formforge.http.resources.form_definitionformforge.http.resources.submissionformforge.http.resources.submitterformforge.http.resources.file_urls.*
File URL options:
enabledtemporaryttl_secondskey
Public link resolution
Form resources expose public_url when a public-link resolver is configured.
Config keys:
formforge.http.public_link.resolverformforge.http.public_link.base_url
The resolver receives the form context and the current request. The context can include keys such as key, owner_type, owner_id, schema, meta, and version, which lets you build tenant-aware links, subdomain-specific URLs, or owner-derived public domains.
<?php
declare(strict_types=1);
namespace App\FormForge;
use EvanSchleret\FormForge\Support\FormPublicLinkResolver;
use Illuminate\Http\Request;
final class TenantAwareFormPublicLinkResolver implements FormPublicLinkResolver
{
public function resolve(array $context, Request $request): ?string
{
$key = trim((string) ($context['key'] ?? ''));
if ($key === '') {
return null;
}
$ownerDomain = $request->route('owner')?->domain ?? $request->getSchemeAndHttpHost();
$prefix = trim(config('formforge.http.prefix', 'api/formforge/v1'), '/');
return rtrim($ownerDomain, '/') . '/' . trim($prefix . '/forms/' . $key, '/');
}
}
public_url is resolved dynamically from the current request. If you need a fixed base URL, set formforge.http.public_link.base_url instead of deriving it from the request host.Model overrides
Overridable keys under formforge.models.*:
form_definitionform_categoryform_submissionsubmission_filestaged_uploadidempotency_keyform_draftsubmission_automation_runsubmission_privacy_policysubmission_privacy_override
Each custom model must extend the corresponding package base model.
Controller overrides
Config keys:
formforge.http.controllers.schemaformforge.http.controllers.submissionformforge.http.controllers.uploadformforge.http.controllers.resolveformforge.http.controllers.draftformforge.http.controllers.management
Rules:
- extend the package controller
- keep method signatures compatible
- call package services instead of duplicating business logic