#Best way to use Laravel with Flutter as a real-time database

1 messages · Page 1 of 1 (latest)

modern nest
#

I'm new to Laravel and websockets in general. I'd like to use it for the backend of my Flutter application and need real-time data.

The first thing I saw was Pusher, however 1) I don't like the idea of being tied into a paid service and 2) Pusher's package for Flutter doesn't seem to support Flutter Desktop which I need (as well as Mobile and Web.

So what's the best way of doing this? I see Laravel Echo, Socket.io, Beyond Code's Laravel Websockets, etc, and it's all very confusing and I don't know where to start.

Can someone point me in the right direction?

vague saddle
#

Echo is a client-side (browser) package and uses the Pusher API, that's basically just a bit of JS to communicate with Pusher.
Then there's Soketi, Socket.io, Beyond Code's Laravel Websockets, those are all websocket servers. They all implement the server-side API from pusher. So, they're all compatible with Laravel Echo. And there's Pusher themselves, that's the server-side, but paid.
So if you're going with one of those options you'd still need a client that's compatible with the Pusher API, so the Pusher package for Flutter can probably connect to all of these. Echo wouldn't come into the picture here, as that's just a JavaScript client

modern nest
# vague saddle Echo is a client-side (browser) package and uses the Pusher API, that's basicall...

Thanks, that helps clear some things up for me.

The Pusher client package for Flutter doesn't seem to support Desktop though. https://github.com/pusher/pusher-channels-flutter

So how would I connect my Flutter Desktop client to my Laravel websocket server?

GitHub

Pusher Channels client library for Flutter targeting IOS, Android, and WEB - GitHub - pusher/pusher-channels-flutter: Pusher Channels client library for Flutter targeting IOS, Android, and WEB

modern nest
#

Do I just connect to them like any other websockets, it's not Laravel/Pusher specific?

Using a websocket package like this? https://pub.dev/packages/web_socket_channel