Our great sponsors
-
flexible-presenter
Easily define just the right data for your InertiaJS views (or anywhere else you want to, uh, flexibly present).
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
There is a "Presenter" pattern for Inertia that can flatten, format or cast to arrays as part of sending your data from the back-end Controllers to the front-end Vue pages: https://github.com/AdditionApps/flexible-presenter But don't over think it. Vue can handle most of your objects, arrays and variables straight out of the controller as props. We've found that when using Inertia it's best to think of Vue as a modern form of Blade so just send the simplest props you can and do the work in the controller.