Skip to main content
Laravel Chorus provides powerful Vue composables and components that make it effortless to build real-time, offline-capable applications using Vue 3’s Composition API. This guide covers everything from basic setup to advanced patterns.

Setup

1. Add the Chorus Provider

Wrap your app’s layout file with the Chorus provider:

2. Use Data in Components

Use Chorus composables to access synchronized data:

Core Composables

useTable Composable

The primary composable that provides both data access and write actions for a table:
Complete Example:

useOffline Composable

Monitor and handle offline state:

useHarmonics Composable

For advanced data access with custom queries:

Optimistic Updates with Rollback

Handle complex optimistic updates with error recovery:

Real-time Collaboration

Build collaborative features with presence indicators:

Built-in Components

OfflineIndicator Component

Ready-to-use component for displaying offline status:

OfflineBanner Component

Simple banner for offline status:

Error Handling

Rejected Operations Handling

Handle and display rejected operations:

TypeScript Support

Vue Chorus comes with full TypeScript support. Define your types and get auto-completion:

Next Steps

React Integration

Learn about React integration patterns

Write Actions

Master server-side write operations

Concepts Deep Dive

Understand Chorus core concepts

Advanced Features

Explore advanced configuration options

You now have everything you need to build powerful real-time Vue applications with Laravel Chorus. The combination of Vue 3’s reactivity system, optimistic updates, offline support, and real-time synchronization will deliver an exceptional user experience.