feat(form-builder): add BindingTypeRegistry as single source of truth for target shapes (WS-6)

Config-driven mapping from (target_entity, target_attribute) to storage
shape (scalar/collection/relation), PHP type, and identity-key
eligibility. Replaces any name-suffix matching (e.g. _tags, _skills) —
those are convention-not-contract and reject by design.

Used by publish guards now and (in session 2) by FormBindingApplicator.

Refs: RFC-WS-6.md §4 (V1)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-25 22:41:25 +02:00
parent b2e9ef8824
commit 0dd991c688
7 changed files with 356 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Providers;
use App\FormBuilder\Bindings\BindingTypeRegistry;
use App\FormBuilder\Purposes\PurposeRegistry;
use App\Models\Company;
use App\Models\CrowdList;
@@ -82,8 +83,13 @@ class AppServiceProvider extends ServiceProvider
base_path('config/form_builder/purposes.php'),
'form_builder.purposes',
);
$this->mergeConfigFrom(
base_path('config/form_builder/binding_targets.php'),
'form_builder.binding_targets',
);
$this->app->singleton(PurposeRegistry::class);
$this->app->singleton(BindingTypeRegistry::class);
// Telescope is a dev-only debugging dashboard. Three-layer
// defense keeps it out of production: composer `dont-discover`