Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion resources/js/Pages/testing.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,26 @@ export default function () {
scope your assertions.
</P>
<P>
Let's dig into the available assertions in detail. First, to assert that the Inertia response has a property,
You may use the <Code>inertiaProps</Code> method to retrieve the props returned in the response.
You can pass a key to retrieve a specific property, and nested properties are supported using "dot" notation.
</P>
<CodeBlock
language="php"
children={dedent`
$response = $this->get('/podcasts/41');

// Returns all props...
$response->inertiaProps();

// Returns a specific prop...
$response->inertiaProps('podcast');

// Returns a nested prop using "dot" notation...
$response->inertiaProps('podcast.id');
`}
/>
<P>
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,
you may use the <Code>has</Code> method. You can think of this method as being similar to PHP's{' '}
<Code>isset</Code> function.
</P>
Expand Down