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
Copy file name to clipboardExpand all lines: resources/js/Pages/testing.jsx
+20-1Lines changed: 20 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,26 @@ export default function () {
86
86
scope your assertions.
87
87
</P>
88
88
<P>
89
-
Let's dig into the available assertions in detail. First, to assert that the Inertia response has a property,
89
+
You may use the <Code>inertiaProps</Code> method to retrieve the props returned in the response.
90
+
You can pass a key to retrieve a specific property, and nested properties are supported using "dot" notation.
91
+
</P>
92
+
<CodeBlock
93
+
language="php"
94
+
children={dedent`
95
+
$response = $this->get('/podcasts/41');
96
+
97
+
// Returns all props...
98
+
$response->inertiaProps();
99
+
100
+
// Returns a specific prop...
101
+
$response->inertiaProps('podcast');
102
+
103
+
// Returns a nested prop using "dot" notation...
104
+
$response->inertiaProps('podcast.id');
105
+
`}
106
+
/>
107
+
<P>
108
+
Let's dig into the <Code>assertInertia</Code> method and the available assertions in detail. First, to assert that the Inertia response has a property,
90
109
you may use the <Code>has</Code> method. You can think of this method as being similar to PHP's{' '}
0 commit comments