Laravel Splade

Laravel Splade

  • Introduction

    • Introducing Splade
    • Credits
    • Automatic installation
    • Manual installation
    • Breeze starter kit
    • Upgrading
    • Roadmap
    • Inertia.js comparison
    • Livewire comparison
  • Basics

    • Navigation and routing
    • Progress bar
    • Toasts
    • Shared data
    • Title and meta tags
    • Lazy loading
    • Server-side rendering (SSR)
  • Components

    • Content
    • Data
    • Defer
    • Errors
    • Event
    • Flash
    • Form
    • Link
    • Modal
    • Rehydrate
    • Script
    • State
    • Teleport
    • Toggle
    • Transition
    • Custom components
  • Form components

    • Overview
    • Input
    • Textarea
    • Select
    • Checkbox
    • Radio
    • File
    • Group
    • Submit
    • Model Binding
  • Table component

    • Overview
    • Built-in Query Builder
    • Bulk Actions
    • Exports
    • Spatie Query Builder
  • Vue components and libraries

    • Custom components
    • Vue libraries
    • Form components
  • Advanced

    • State management
    • Persistent layout
    • Event bus
    • Customization
    • Translations
    • Exception handling
    • How Splade works

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>