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
{{ message }}
This repository was archived by the owner on Jan 12, 2023. It is now read-only.
Make sure you have your Inertia template file set at `resources/views/app.blade.php`.
17
+
### Setup
18
+
19
+
The Inertia adapter works for any page or entry content available through Statamic Collections.
20
+
21
+
By default, all Inertia-enabled pages will be expecting an `app` template, which should be located at `resources/views/app.blade.php`. This is the base page that any Inertia app is looking for, and should contain the `@inertia` directive. The template can be defined either at the collection or page level, but it must be `app`.
Finally, you need to create a `Pages` folder in `resources/js`. This is where your app will be looking for Vue components that match the resolved naming of your Statamic pages.
24
56
57
+
```sh
58
+
|_ resources
59
+
|_ js
60
+
|_ Pages
61
+
|_ About
62
+
|_ Team.vue
63
+
|_ Home.vue
64
+
```
65
+
66
+
Both [server-side setup](https://inertiajs.com/server-side-setup) and [client-side setup](https://inertiajs.com/client-side-setup) full instructions are available on Inertia's website.
67
+
68
+
### Component Naming
69
+
70
+
As you can see in the folder structure above, your Vue component naming and location must match the Statamic collection hierarchy + page slug combo for any Inertia-enabled pages. The adapter will automatically build these paths based on the page's URL and slug.
All the typical data passed to a Statamic page as objects will now be available to your page as `props`. The `props` will contain all of the expected attributes and data. For example, the Inertia response's `props` object could look like:
0 commit comments