As of August 2024, Splade is no longer actively maintained. Though we will try to keep up with future Laravel and PHP versions, we discourage using Splade in new projects.

After a period of reflection, we've come full circle and decided to bring the magic of Splade back to Inertia, where it all started. Please check out this new chapter in our journey: Inertia UI.

Shared Data

Sometimes you might want to share additional data from the backend to the frontend. You can do this by using the share method on the Splade facade:

Splade::share('adminLastSeenAt', Admin::value('last_seen_at')->toIso8601String());

In the frontend, you can access shared data using the State Component:

<x-splade-state>
<p>Admin last seen at: <span v-text="state.shared.adminLastSeenAt" /></p>
</x-splade-state>