laravel-websockets-demo icon indicating copy to clipboard operation
laravel-websockets-demo copied to clipboard

Upgrade Project to Laravel V9

Open mhyeganeh opened this issue 2 years ago • 9 comments

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... 💪😎

websocket login

mhyeganeh avatar Mar 21 '22 17:03 mhyeganeh

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 avatar Mar 23 '22 14:03 erikn69

@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.

mhyeganeh avatar Mar 25 '22 11:03 mhyeganeh

Maybe merge before laravel V10 release...? 🙄😉

Closes #17 Closes #21

@freekmurze @mpociot

mhyeganeh avatar Mar 31 '22 11:03 mhyeganeh

There have been many PRs trying to update this since Laravel V6, none have been merged Example #12, still open

PaolaRuby avatar Apr 04 '22 13:04 PaolaRuby

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 avatar Jul 20 '22 03:07 treckstar

@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 😉

Untitled Project

mhyeganeh avatar Jul 25 '22 16:07 mhyeganeh

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

cesarreyes3 avatar Jul 25 '22 16:07 cesarreyes3

@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 😉

Untitled Project Untitled Project

Thanks that looks great, thanks for adding that in. Definitely helped me see how easy that was; I was definitely over complicating it lol.

treckstar avatar Jul 25 '22 23:07 treckstar

V10 ??

cesarreyes3 avatar Apr 13 '23 19:04 cesarreyes3