Skip to content

panicoding/livewire-mercure-demo

 
 

Repository files navigation

livewire-mercure-demo.mp4

Livewire Mercure Demo

This demo showcases the use of Mercure (a modern substitute for WebSockets) to send real-time public and private messages in a Laravel Livewire application—no page refresh or polling required.

Quickstart

  1. Clone the repository:git clone https://github.com/benbjurstrom/livewire-mercure-demo.git
  2. Enter the directory: cd livewire-mercure-demo
  3. Install php dependencies: composer install
  4. Install node dependencies: npm install && npm run build
  5. Start the docker environment: ./vendor/bin/sail up
  6. Run migrations and seeders: ./vendor/bin/sail artisan migrate:fresh --seed
  7. Access the app at http://localhost/login. Login with [email protected] and password.
  8. Use the Artisan command php artisan message:send to send a message.

Technical Details

This repo was created from a fresh Laravel 10 install with the Laravel Breeze package added. All additional configuration needed to get Mercure up and running can be found in this diff: https://github.com/benbjurstrom/livewire-mercure-demo/commit/ab62d8276df652750b77ac04183b010724c5561d

Note: This demo uses a patched version of Livewire.

About

A demo Laravel app showcasing Mercure with Livewire

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 60.1%
  • Blade 39.3%
  • Other 0.6%