Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude except props from partial reloads #622

Merged
merged 1 commit into from
May 17, 2024

Conversation

lepikhinb
Copy link
Contributor

@lepikhinb lepikhinb commented May 14, 2024

The PR introduces an ability to exclude properties from partial responses. The except option can be used together with only to refine nested props.

The corresponding client-side PR: inertiajs/inertia#1876

router.visit(url, {
  only: ['auth'],
  except: ['auth.user'],
})
$props = [
    // Included on partial reload
    'auth' => [
        // Excluded from partial reload
        'user' => new LazyProp(function () {
            return [
                'name' => 'Jonathan Reinink',
                'email' => 'jonathan@example.com',
            ];
        }),
        // Included on partial reload
        'refresh_token' => 'value',
    ],
    // Excluded from partial reload
    'shared' => [
        'flash' => 'value',
    ],
];

@driesvints
Copy link
Collaborator

Please make sure to mark this as ready for review if you need one.

@lepikhinb
Copy link
Contributor Author

@driesvints just want to get the client PR ready first

@lepikhinb lepikhinb marked this pull request as ready for review May 14, 2024 23:18
@taylorotwell taylorotwell merged commit 5675663 into inertiajs:1.x May 17, 2024
26 checks passed
@reinink reinink changed the title [1.x] Exclude properties from partial responses [1.x] Exclude except props from partial reloads May 25, 2024
@reinink reinink changed the title [1.x] Exclude except props from partial reloads Exclude except props from partial reloads May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants