naotake51/laravel-recursive-only
A Laravel package that brings recursive-only behavior to Eloquent, letting you load just a chosen whitelist of attributes and relations and have it applied consistently across nested relationship levels.
Laravel Recursive Only provides a recursive version of Laravel’s only() helper for nested arrays. It walks each level of the data and keeps only the specified keys, preserving the original structure while removing everything else—useful for sanitizing nested request, configuration, or API payload data.
only() to nested arraysHow can I help you explore Laravel packages today?