Replies: 2 comments
-
Not at the moment, but you can create a new transformer based upon the DTO transformer which implements this feature. |
Beta Was this translation helpful? Give feedback.
0 replies
-
For anyone wondering, you can do this without writing a transformer by doing this: // ...
use Spatie\LaravelData\Attributes\WithoutValidation; // Skips validation when creating (optional)
use Spatie\TypeScriptTransformer\Attributes\Hidden; // Excludes it from generated TypeScript
// ...
#[TypeScript()]
class CreatePostData extends Data
{
#[Hidden, WithoutValidation] // Apply here
public string $hideMe;
}
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, is it any way to exclude some properties from transforming to TypeScript?
I want to add some variables from route, but I don't want to show them in newly created TypeScript
Beta Was this translation helpful? Give feedback.
All reactions