You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding Inertia to your Leaf app doesn't change the way you handle routing, so you'll still be using your controllers, except that instead of a Blade view, you would return an inertia view:
You can find more information on using Inertia with your frontend framework in the [Inertia documentation](https://inertiajs.com/).
125
125
126
+
## Shared Data <Badgetext="New"type="tip" />
127
+
128
+
Sometimes, you might want to share data across all your inertia views. Leaf MVC makes this super easy by providing a simple way to do this. You can use the `Inertia::share()` method to share data across all your inertia views. You can do this in your `app/routes/index.php` file like this:
Using a function to share data is useful when you want to share dynamic data, because the function won't be executed until the data is actually needed, so if you share something like a flash message which can only be read once, it won't be lost.
141
+
126
142
## Generating Inertia Views
127
143
128
144
Once you set up your preferred frontend framework using the `view:install` command, Leaf MVC automatically reconfigures the framework to work primarily with your tooling. So you can generate a new inertia view using the `g:template` command.
0 commit comments