Kinetic is a package that adds a view-composer-like feature to the Inertia.js Laravel adapter. This should be very intuitive if you are already familiar with how view and composers work in Laravel. You can use Inertia::composer() in any service provider to register composers for specific components. The first argument accepts either a string or an array of Inertia components, and the second argument accepts either a class string or a closure.

Then you can call the with() method from the factory class to set the composed props like so: Inertia::composer('User/Profile', function (ResponseFactory $inertia) { $inertia->with([ 'post' => [ 'subject' => 'Hello World!', 'description' => 'This is a description.' ]]); }); Multiple composers
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners