- Controllers must use a custom request for validation
- Rules from the validation request will be parsed into types
- Parsed rules are then used to generate a typescript interface
- Use typescript interface freely
php artisan export:requestsA config can be specified by making config/request-types.php
See https://github.com/tighten/ziggy#filtering-routes
To extend existing type resolving functionality, you can specify a custom type resolver class in config
// config/request-types.php
return [
'resolver' => MyCustomResolver::class
]Your custom resolver should implement TypesResolverInterface
// MyCustomResolver.php
class MyCustomResolver implements TypesResolverInterface {
// ...
}Output can be altered similarly to Ziggy
// config/request-types.php
return [
'output' => [
'file' => MyCustomOutput::class,
],
]Your custom output generator should implement CodeOutputGeneratorInterface
// MyCustomOutput.php
class MyCustomOutput implements CodeOutputGeneratorInterface {
// ...
}