Skip to content

Instantly share code, notes, and snippets.

View Rubrasum's full-sized avatar
💭
meow

Rubrasum Rubrasum

💭
meow
View GitHub Profile
@Rubrasum
Rubrasum / share.php
Last active February 28, 2025 03:57
Inertia Share with a condition to check for inertia load or regular site load
// Give me a better way of describing the two different loads. full request vs inertia request? idk
// Here is my original share in a service provider
public function boot(SidebarService $sidebar): void
{
// Share sidebar items with Inertia for global access
Inertia::share('sidebarItems', $sidebar->getItems());
}