Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Inertia Shared Data Provider

Laravel Inertia Shared Data Provider Laravel Package

ebess/laravel-inertia-shared-data-provider

A Laravel package for defining shared data providers for Inertia.js, letting you resolve common props once and pass them to every page without repeating code across controllers. Keeps Inertia responses consistent and easy to maintain.

View on GitHub
Deep Wiki
Context7

A lightweight Laravel package for organizing Inertia shared data into dedicated provider classes. Instead of crowding the HandleInertiaRequests middleware, register providers that resolve and share props consistently across every Inertia response.

  • Provider-based sharing keeps shared props modular and testable
  • Works with Laravel and Inertia.js
  • Register multiple providers with a simple, explicit setup
  • Keeps middleware clean and shared data easy to maintain
Frequently asked questions about Laravel Inertia Shared Data Provider
What is ebess/laravel-inertia-shared-data-provider used for?
It is a Laravel package for sharing data with Inertia.js views through dedicated data provider classes. It helps keep controllers and middleware clean while making shared props reusable and testable across your application.
How do I install ebess/laravel-inertia-shared-data-provider?
Install it with Composer using composer require ebess/laravel-inertia-shared-data-provider. Then follow the package README for any registration or publishing steps and define your shared data providers. Check the README for the exact commands for your Laravel version.
How is this package different from Inertia::share or middleware sharing?
Inertia::share and middleware are built-in ways to share props, but the logic often lives inline in service providers or middleware. This package moves shared data into dedicated provider classes, making it more organized, reusable, and easier to test. For very small apps, the built-in options may still be sufficient.
Which Laravel versions does this package support?
Compatibility is defined by the package composer.json, including its Laravel and inertiajs/inertia-laravel constraints. Check those constraints against your application before installing. Because Laravel support changes over time, verify the latest release details on Packagist or GitHub.
How do I create and register a shared data provider?
You create a dedicated provider class that returns the props you want shared with Inertia views, then register it using the package's documented mechanism. The exact contract and registration syntax are in the README. Follow those instructions so the provider is resolved correctly by the package.
Can I share authenticated user data or app settings with every Inertia page?
Yes, common use cases include the authenticated user, notification counts, navigation menus, and application settings. Putting that logic in a provider gives every Inertia response consistent shared props. Keep the provider efficient because it runs during Inertia requests.
Does it work with Vue, React, and Svelte Inertia frontends?
Yes, the package works on the Laravel side and shares data through Inertia's prop system. The shared props are available whether your Inertia frontend uses Vue, React, or Svelte. It does not require a specific frontend adapter.
How can I test shared Inertia data providers?
Because providers are dedicated classes, you can instantiate them and assert the returned array directly. You can also use Laravel and Inertia testing helpers to make requests and assert the shared props. This testability is a main benefit over inline sharing logic.
Are there performance concerns with shared data providers in production?
The package itself is lightweight, but shared data is resolved on Inertia requests. Avoid expensive queries or heavy work inside providers, cache slow data where appropriate, and only share what pages actually need. Profile your app if you add many global props.
Is ebess/laravel-inertia-shared-data-provider actively maintained?
Review the GitHub repository for recent commits, releases, and open issues, and check Packagist for the latest version and constraints. Pin a tested version in composer.json for production use. Since maintenance activity can change, verify it before adopting the package for a long-term project.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager