Category : laravel-websockets

I’ve been trying to receive notifications in real-time, such as in this video: https://www.youtube.com/watch?v=i6Rdkv-DLwk&t=1081s by using Pusher – The app is connected to pusher, I receive the notifications events in real-time with Pusher over the console, but I cannot update the notifications count in real-time, on the frontend(see my picture below the code), the new ..

Read more

Iam trying to perform a post request with: async sendMessage({ commit }, data) { window.apiClient.defaults.headers.common[‘X-Socket-Id’] = window.Echo.socketId() var response = await window.apiClient.post(`/messages`, data, { headers: { Authorization: ‘Bearer ‘ + token, ‘Accept’: ‘*’, ‘Content-Type’: ‘*’ }, }) IN my main.js I set up: window.apiClient = axios.create({ baseURL: "http://127.0.0.1:8000/api/", headers: { Accept: ‘application/json’, ‘Content-Type’: ‘application/json’, Authorization: ..

Read more

I want to install Laravel Web-Socket package but I face some errors when I run this command composer require beyondcode/laravel-websockets Using version ^1.12 for beyondcode/laravel-websockets Running composer update beyondcode/laravel-websockets –with-all-dependencies Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 – Root composer.json ..

Read more

after implementing a simple GraphQl query such as a simple Mutation and Subscription i get this error when i try to run this subscription into graphql-playground: subscription { userCreated{ name username password } } i this error: { "error": "Could not connect to websocket endpoint ws://127.0.0.1:8000/graphql. Please check if the endpoint url is correct." } ..

Read more

im trying to deploy a laravel websockets:serve on a digital ocean droplet, i’ve created a command using supervisor to launch the serve but im getting this error Starting the WebSocket server on port 6001… RuntimeException Failed to listen on "tcp://0.0.0.0:6001": Address already in use at /var/www/taller/vendor/react/socket/src/TcpServer.php:172 168| STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, 169| stream_context_create(array(‘socket’ => $context + ..

Read more

Is there a way we can check if user is trying to connect to a channel in different tab or browser in which he is already connected in laravel websockets window.Echo.join("homework.1341") .here(Husers => { console.log(Husers) }) .joining(user => { console.log(user, ‘user1’) }) .leaving(user => { console.log(user) }).error((error) => { console.error(error); }) .notification((notification) => { console.log(notification.type); ..

Read more

Laravel-Websockets not working over HTTPS on Laragon (Apache) Currently I’m using the default Laragon generated SSL certificate, I’m not sure how to add the SSL certificates with my Websocket. My project directory: E:WebsiteslaravelComputerReflex My SSL Directory: E:laragonetcssl On the documention it’s mentioned to add the SSL certificate path on .env file, which I’ve tried but ..

Read more

How to run laravel websockets in laragon? when run command to start websockets php artisan websockets:serve it’s not working because https://imgur.com/ODkZC8d and its still suck there https://imgur.com/6lzEOGX this is error on browser WebSocket connection to ‘wss://nextlevelbot.test:6001/app/mykey?protocol=7&client=js&version=6.0.2&flash=false’ failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED Sourc..

Read more

I’m using laravel-websockets under Jetstream with laravel-modules on localhost. Public channels work well but when I switch to private channels I get the following error: POST http://127.0.0.1:8000/broadcasting/auth [HTTP/1.1 500 Internal Server Error 104ms] Here is how my code looks like, any help would be much appreciated and thank you in advance! resources/js/bootstrap.js import Echo from ..

Read more

I install laravel websockets is working fine in localhost when i upload in server (inmotionhosting, Centos7) is not work brodcasting.php ‘pusher’ => [ ‘driver’ => ‘pusher’, ‘key’ => env(‘PUSHER_APP_KEY’), ‘secret’ => env(‘PUSHER_APP_SECRET’), ‘app_id’ => env(‘PUSHER_APP_ID’), ‘options’ => [ ‘cluster’ => env(‘PUSHER_APP_CLUSTER’), ‘encrypted’ => true, ‘host’ => ‘rdms.sawagroup.org’, ‘port’ => 8443, ‘scheme’ => ‘https’, ‘curl_options’ => ..

Read more

Making chat in laravel 8 / beyondcode/laravel-websockets 1.12 / laravel-echo 1.11.1 / pusher-js 7.0.3 app when I failed to to catch whisper event. Reading here https://laravel.com/docs/8.x/broadcasting#receiving-broadcasts I do in my vue file : <template> <div class="container"> <div class="row" v-if="currentRoom"> <h4>{{ currentRoom.name }}</h4> <div class="col-sm-12"> <div class="table-responsive" v-if="is_page_loaded && messages.length"> <table class="table table-striped text-primary"> <tbody> <tr ..

Read more

I have server where I serve Laravel app from sub-directory like https://laravel-apps.test/app1. It throws this error WebSocket connection to ‘wss://laravel-apps.test:6001/app/Kfjaina1m7?protocol=7&client=js&version=7.0.3&flash=false’ failed:. It works if I serve the app directly like https://laravel-app1.test. I’m sure I’m missing something but I’m not figuring out what? Probably the above URL should also contain the sub-directory string when making connect ..

Read more

I want to install Laravel WebSocket using composer but everytime I receive this error. No matter if project is new and fresh, or an old project, every time I want to install WebSocket I receive this error: Root composer.json requires laravel/framework ^8.40, found laravel/framework[v8.40.0, …, 8.x-dev] but these were not loaded, likely because it conflicts ..

Read more

To implement chat In Laravel 8/vue 2.6 I added beyondcode/laravel-websockets and reading some manuals I found that I need to use pusher packages, like laravel-echo and pusher-js not not pusher App API. So I tried to make as in .env : BROADCAST_DRIVER=pusher PUSHER_APP_ID=myId PUSHER_APP_KEY=myKey PUSHER_APP_SECRET=mySecret PUSHER_APP_CLUSTER=eu MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" and in resources/js/bootstrap.js : import Echo from ..

Read more