laravel-websockets-demo
laravel-websockets-demo copied to clipboard
Upgrade Project to Laravel V9
It's so beneficial to have a simple demo project which JUST WORKS! But because of old version of laravel and other dependencies it was so difficult to prepare the required environment and do up and running :(
So I decided to perform a Full Upgrade to this demo project as it follows:
PHP: v7 => v8
Laravel: v5 => v9
pusher-php-server: v3 => v7
Vue.js: v2 => v3
Bootstrap: v4 => v5
pusher-js: v4 => v7
laravel-echo: v1.5 => v1.11
laravel-mix: v2 => v6
and so many different syntax and config changes... 💪😎
Duplicate of #22 ??
Also upgrade .env.example
based on config/websockets.php#L16
LARAVEL_WEBSOCKETS_PORT=6001
MIX_LARAVEL_WEBSOCKETS_PORT="${LARAVEL_WEBSOCKETS_PORT}"
so in config/broadcasting.php
can be added
'port' => env('LARAVEL_WEBSOCKETS_PORT', 6001),'
and on resources/js/bootstrap.js
wsPort: process.env.MIX_LARAVEL_WEBSOCKETS_PORT || 6001,
wssPort: process.env.MIX_LARAVEL_WEBSOCKETS_PORT || 6001,
@erikn69
Hi again;
Actually I saw #22 after I submited this PR... 🙄 Besides that this PR includes Vue.js upgrade (v2 => v3
), Bootstrap upgrade (v4 => v5
) and other syntax updates as well which helps specially beginners up and running much easier.
I've just sent another commit which includes all the changes that you mentioned above.
Maybe merge before laravel V10 release...? 🙄😉
Closes #17 Closes #21
@freekmurze @mpociot
There have been many PRs trying to update this since Laravel V6, none have been merged Example #12, still open
Tried this out, worked really well for me.
One thing I was trying to add was making the ChatMessage.vue
component scroll to the bottom of the screen when a message is sent/on load if they exist/overflow. I didn't get that working in the amount of time I had to mess with it though.
I had one minor issue during the install, but may have actually been my fault. Also it was a bit ago so I don't remember exactly what the message was, but it was something like this.
🤔 💭
In the docroot/resources/js/bootstrap.js
the config for Echo
, one of the properties (maybe host
, key
, or pusher
), had a value of websocket
or something. It seemed to not be taking my .env
file stuff.
So it just needed to the php artisan *:clear
commands and eventually it fixed itself. Can't remember if there was anything else. I do recall running those commands multiple times before it actually worked though.
Otherwise, great work! Hopefully it gets merged or used somehow. 🤙
@treckstar Thanks for your feedback.
I've just pushed some commits to add scroll to bottom of chats list functionality and hope you like it 😉
Really nice, but beyondcode/laravel-websockets is almost abandoned, I think that this PR is not going to be merged Maybe try to make a soketi demo soketi/soketi
@treckstar Thanks for your feedback.
I've just pushed some commits to add scroll to bottom of chats list functionality and hope you like it 😉
Thanks that looks great, thanks for adding that in. Definitely helped me see how easy that was; I was definitely over complicating it lol.
V10 ??