Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Duo Laravel Package

joshcirre/duo

View on GitHub
Deep Wiki
Context7
v0.1.0

Duo v0.1.0 - Local-First Syncing for Laravel & Livewire

First public release of Duo - a local-first IndexedDB syncing package for Laravel and Livewire applications.

๐Ÿ“ฆ Package Information

This release includes:

  • Composer Package: joshcirre/duo - Laravel service provider and traits
  • NPM Package: [@joshcirre](https://github.com/joshcirre)/vite-plugin-duo - Vite plugin and client library

โœจ Features

Core Functionality

  • ๐Ÿ”„ Automatic IndexedDB Syncing - Transparent client-side caching of Eloquent models
  • โšก Optimistic Updates - Instant UI updates with background server synchronization
  • ๐Ÿ“ก Offline Support - Automatic offline detection with sync queue that resumes when back online
  • ๐ŸŽฏ Livewire Integration - Seamless integration with Livewire 3+ and Volt components
  • ๐Ÿš€ Zero Configuration - Add one trait and Duo handles the rest

Full Page Caching

  • ๐Ÿ’พ Offline Page Caching - Complete page caching with service workers
  • ๐Ÿ”ง Dynamic Service Worker - No publishing needed, served automatically from package
  • ๐Ÿ”’ CSRF Protection - [@duoMeta](https://github.com/duoMeta) directive includes CSRF token automatically
  • ๐Ÿ–ผ๏ธ Asset Caching - Caches HTML, CSS, JS, images, and fonts for true offline mode

Developer Experience

  • ๐Ÿ“Š Visual Sync Status - Built-in component showing online/offline/syncing states
  • ๐Ÿ“ฆ Type-Safe - Full TypeScript support with auto-generated types
  • ๐Ÿ”Œ Vite Plugin - Automatic manifest generation with file watching
  • ๐Ÿงช Workbench Demo - Fully functional todo list demo included

๐Ÿ“š Installation

Composer

composer require joshcirre/duo

NPM

npm install -D [@joshcirre](https://github.com/joshcirre)/vite-plugin-duo

๐Ÿš€ Quick Start

  1. Add the Syncable trait to your models:
use JoshCirre\Duo\Syncable;

class Todo extends Model
{
    use Syncable;
}
  1. Add the WithDuo trait to your Livewire/Volt components:
use JoshCirre\Duo\WithDuo;

new class extends Component {
    use WithDuo;
    // ...
}
  1. Add [@duoMeta](https://github.com/duoMeta) to your layout:
<head>
    [@vite](https://github.com/vite)(['resources/css/app.css', 'resources/js/app.js'])
    [@duoMeta](https://github.com/duoMeta)
</head>
  1. Configure Vite:
import duo from '[@joshcirre](https://github.com/joshcirre)/vite-plugin-duo';

export default defineConfig({
    plugins: [duo()],
});

That's it! Your app now has local-first syncing with offline support.

๐Ÿ“– Documentation

๐Ÿ™ Acknowledgments

Built with:

  • Laravel
  • Livewire
  • Dexie.js
  • Vite

๐Ÿ“„ License

MIT License - see LICENSE for details.


Note: This is a 0.x release, meaning the API may change before 1.0. Please report any issues on GitHub.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle