Lands the v1.0 purpose registry (WS-2 of the consolidation sprint) as a first-class concept: a `PurposeDefinition` value object, a `PurposeRegistry` service keyed by slug, and a declarative `config/form_builder/purposes.php` registry with exactly the seven purposes from ARCH-CONSOLIDATION §6.4. Also rebuilds the morph-map in `AppServiceProvider::boot` into three labelled blocks: (1) domain subject types derived from `PurposeRegistry::allSubjectTypes()`, (2) non-purpose domain types hardcoded with comments (form_schemas owner_types, activity-log subjects), (3) framework types (spatie/activitylog; Sanctum stays absent per addendum Q4). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
16 lines
337 B
PHP
16 lines
337 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\FormBuilder\Purposes\Exceptions;
|
|
|
|
use RuntimeException;
|
|
|
|
final class PurposeNotFoundException extends RuntimeException
|
|
{
|
|
public static function forSlug(string $slug): self
|
|
{
|
|
return new self("Purpose '{$slug}' is not registered in config('form_builder.purposes').");
|
|
}
|
|
}
|