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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners