https://github.com/ferdiunal/laravel-echo-vue3
https://github.com/ferdiunal/laravel-echo-vue3
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ferdiunal/laravel-echo-vue3
- Owner: ferdiunal
- Created: 2022-09-24T10:52:01.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-24T10:57:40.000Z (over 2 years ago)
- Last Synced: 2025-05-15T02:11:59.050Z (25 days ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 1
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Laravel Echo Vue
This package enables the Laravel Echo library to set the property for Vue 3. Laravel Echo setup is the same as in the document.
## Install
via yarn
```bash
yarn add laravel-echo-vue3
```or via npm
```bash
npm install --save laravel-echo-vue3
```If you are going to use Pusher you need to install pusher-js
via npm
```bash
npm install --save pusher-js
```or via yarn
```bash
yarn add pusher-js
```## Usage
###Â Initialize
```js
import App from '@/App.vue'
import Pusher from 'pusher-js';
import LaravelEcho from "laravel-echo-vue3"const app = createApp(App)
const options = {
broadcaster: 'pusher',
key: import.meta.env.VITE_PUSHER_APP_KEY,
cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER,
forceTLS: true
}app.use(LaravelEchoVue, {
...options,
client: new Pusher(options.key, options)
})app.mount('#app')
```