inertiajs / inertia-laravel

The Laravel adapter for Inertia.js.
https://inertiajs.com
MIT License
2.08k stars 234 forks source link

Page props transform #457

Closed bolivir closed 1 year ago

bolivir commented 2 years ago

Hi,

currently my backend is returning page properties as resources. These resources are returned in the json api spec format.

Now my issue is that i cannot transform the page props in vue directly. It would be super nice to have the possibility to hydrate the prop to typescript model/class.

Is there any way to do the transformation before? I cant be the only one who is using json api spec formats and needs those transformations

reinink commented 1 year ago

Hey thanks for this suggestion, but in general Inertia is designed to work with ready-to-go data from the server, and we don't currently have any built-in way to transform that data client-side.

I'd recommend discussing this on our Discord channel or GitHub Discussions, as this isn't a bug with the Laravel adapter.

Good luck! 👍