Skip to content

Commit 1e7755e

Browse files
committed
Add readme
1 parent a61b406 commit 1e7755e

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

Readme.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Inertia Response Renderer
2+
3+
This package provides an Inertia.js response renderer for Arcanist.
4+
5+
> The real docs are still being written, but here’s a really quick
6+
> introduction.
7+
8+
## Installation
9+
10+
Install the package through composer (you still need the main Arcanist package
11+
installed).
12+
13+
```
14+
composer require laravel-arcanist/inertia-response-renderer
15+
```
16+
17+
Inside `config/arcanist.php`, change the `renderers.renderer` key to
18+
`Arcanist\InertiaResponseRenderer::class`.
19+
20+
That’s it.
21+
22+
## How it works
23+
24+
The reponse renderer will try and resolve step templates via the following
25+
convention:
26+
27+
```
28+
resources/js/Pages/Wizards/{wizard-slug}/{step-slug}.vue
29+
```
30+
31+
You can configure the `Wizard` path prefix by changing the
32+
`renderers.inertia.component_base_path` setting in the config.
33+
34+
## View Data
35+
36+
Arcanist passes a `step` and `wizard` prop to all views. These can be accessed
37+
in the usual Inertia way.
38+
39+
```javascript
40+
this.$page.props.arcanist.wizard
41+
42+
this.$page.props.arcanist.step
43+
```
44+
45+
Please refer to the [main documentation](https://laravel-arcanist.com/getting-started#accessing-data-in-a-view) for a more detailed explanation of
46+
these variables.
47+

0 commit comments

Comments
 (0)