Skip to content

qruto/laravel-wave-demo

Repository files navigation

Laravel Wave Logo Demo

🌐 Go to Application

About

Broadcasting the latest tweets with following tags: #laravel, #php, #javascript, #vuejs, #reactjs, @reactjs, @vuejs, @laravelphp, @laravelnews, @LaravelLinks, @LaravelLivewire, @Alpine_JS, @inertiajs, #inertiajs, @tailwindcss, #tailwindcss.

Powered by Laravel Wave.

Source

Default Echo setup in resources/js/bootstrap.js:

import Echo from "laravel-echo";

import { WaveConnector } from "laravel-wave";

window.Echo = new Echo({ broadcaster: WaveConnector });

New tweets listener in resources/js/Components/TweetList:

import { ref } from "vue";

const tweets = ref([]);

window.Echo.channel("twitter-stream").listen("NewTweet", (e) =>
    tweets.value.unshift(e)
);

Broadcasting a simple public event NewTweet fires.

Installation

composer install
npm install
npm run dev

Fill twitter API credentials in .env file.

TWITTER_HANDLE=
TWITTER_API_KEY=
TWITTER_API_SECRET_KEY=
TWITTER_BEARER_TOKEN=

Run stream listener:

php artisan twitter:stream

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published