Is it possible to dynamically type the HandleInertiaRequest share function?

37 Views Asked by At

I'd like to dynamically type the HandleInertiaRequest share function using Spatie Laravel Data and the Typescript transformer.

This is to have a dynamic type that I can use in my front-end to type the usePage.

My first idea was that Middleware from Inertia would extend Data from Spatie and then I could use #[TypeScript] for HandleInertiaRequest, but this wasn't the right way.

I don't have enough experience of Inertia to know whether this is possible. Any one have an idea ?

Thank you in advanced

0

There are 0 best solutions below