Skip to content

Mapping property name and validation problem/question #709

Closed Answered by aalaily
aalaily asked this question in Q&A
Discussion options

You must be logged in to vote

If it helps anyone, for the mapper to work as expected you must add the Spatie\LaravelTypeScriptTransformer\Transformers\SpatieStateTransformer::class to your typescript-transformer.php configuration file as follows:

    'transformers' => [
        Spatie\LaravelData\Support\TypeScriptTransformer\DataTypeScriptTransformer::class,
        Spatie\LaravelTypeScriptTransformer\Transformers\SpatieStateTransformer::class,
        Spatie\LaravelTypeScriptTransformer\Transformers\DtoTransformer::class,
        Spatie\TypeScriptTransformer\Transformers\DtoTransformer::class,
        Spatie\TypeScriptTransformer\Transformers\EnumTransformer::class,
    ],

Note that adding Spatie\LaravelTypeScriptT…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by aalaily
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant