-
Notifications
You must be signed in to change notification settings - Fork 44
[EDU-1984] - Create Laravel getting started guide #2730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EDU-1984] - Create Laravel getting started guide #2730
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
8f75a8f
to
bd8ce26
Compare
bd8ce26
to
327b2ea
Compare
1bd0528
to
962aecb
Compare
``` | ||
</Code> | ||
|
||
## Step 6: Create a frontend file to listen for events <a id="step-6"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Including the css file is unnecessary—it distracts the user and shifts focus away from the main content of the documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be helpful to include a screenshot from https://github.com/ably-labs/laravel-broadcast-app to demonstrate that we have a functioning app and provide an instant display of broadcaster capabilities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
link to https://github.com/ably-labs/laravel-broadcast-app missing
@@ -0,0 +1,484 @@ | |||
--- | |||
title: "Getting started: Pub/Sub in Laravel" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title: "Getting started: Pub/Sub in Laravel" | |
title: "Getting started: Laravel broadcasting using ably" |
The current integration of Ably with Laravel no longer reflects a traditional pub/sub pattern.
At the same time, Laravel section under the "Pub/Sub" category is somewhat misleading, as it doesn’t expose any of the core pub/sub APIs.
Instead, it’s built on top of pub/sub—similar to other higher-level products like Chat, LiveSync, and LiveObjects. It offers a full-fledged integration specifically tailored to Laravel and Laravel Echo, exposing framework-specific APIs. I would recommend avoiding the pubsub term in any of the ably laravel documentation, it's misleading for number of reasons : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider moving this guide to a top-level section, as it aligns more closely with a dedicated Laravel integration than with generic pub/sub functionality. Or better, if we can have a separate page for the same, since none of the pubsub template is compatible with it.
* Revisit the basics of [Pub/Sub](/docs/pub-sub?lang=php) | ||
* Explore more [advanced](/docs/pub-sub/advanced?lang=php) Pub/Sub concepts | ||
* Read more about how to use [presence](/docs/presence-occupancy/presence?lang=php) in your apps | ||
* Fetch message [history](/docs/storage-history/history?lang=php) in your apps | ||
* Learn about [Laravel Broadcasting](https://laravel.com/docs/broadcasting) with Ably |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Revisit the basics of [Pub/Sub](/docs/pub-sub?lang=php) | |
* Explore more [advanced](/docs/pub-sub/advanced?lang=php) Pub/Sub concepts | |
* Read more about how to use [presence](/docs/presence-occupancy/presence?lang=php) in your apps | |
* Fetch message [history](/docs/storage-history/history?lang=php) in your apps | |
* Learn about [Laravel Broadcasting](https://laravel.com/docs/broadcasting) with Ably | |
* Read ably laravel doc at [Ably laravel broadcaster github](https://github.com/ably/laravel-broadcaster) | |
* Read ably laravel echo at [Ably laravel echo github](https://github.com/ably-forks/laravel-echo) | |
* Try running our [ably laravel chat app](https://github.com/ably-labs/laravel-broadcast-app) | |
* Learn more about [Laravel Broadcasting](https://laravel.com/docs/broadcasting) |
18f4968
to
5753ca8
Compare
|
||
It will take you through the following steps: | ||
|
||
* Create a client and establish a connection to Ably with the Laravel Broadcaster and Echo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we provide some context on the broadcaster (should this be Ably Laravel Broadcaster?) and that we use a fork of echo? WDYT?
``` | ||
</Code> | ||
|
||
This command will create a `PublicMessageEvent.php` file in the `app/Events` directory. Replace the content of the files with following to handle the broadcasting of messages to a public channel: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command will create a `PublicMessageEvent.php` file in the `app/Events` directory. Replace the content of the files with following to handle the broadcasting of messages to a public channel: | |
This command will create a `PublicMessageEvent.php` file in the `app/Events` directory. Replace the content of the file with following to handle the broadcasting of messages to a public channel: |
|
||
## Step 4: Test the API route <a id="step-4"/> | ||
|
||
To test the API route, first you need a subscriber to a channel. You can use the Ably CLI to subscribe to a channel: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"...at least one client subscribed to the channel" maybe?
|
||
## Step 5: Frontend setup <a id="step-5"/> | ||
|
||
Install `Ably`, Ably's fork of `laravel-echo`, and `axios` in your Laravel project: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though it's the import name, I think it's odd to say "Install Ably". We should clarify that it's Pub/Sub
* Read more about [Ably Laravel Echo](https://github.com/ably-forks/laravel-echo) | ||
* Fetch message [history](/docs/storage-history/history?lang=php) in your apps | ||
* Learn more about [Laravel Broadcasting](https://laravel.com/docs/broadcasting) | ||
* Explore the A[bly Laravel Broadcast app](https://github.com/ably-labs/laravel-broadcast-app), with authentication, multiple rooms, and private rooms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Explore the A[bly Laravel Broadcast app](https://github.com/ably-labs/laravel-broadcast-app), with authentication, multiple rooms, and private rooms. | |
* Explore the [Ably Laravel Broadcast app](https://github.com/ably-labs/laravel-broadcast-app), with authentication, multiple rooms, and private rooms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add some context around what this app is if we're linking out to it.
0151268
to
fbaeff6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 small typo but LGTM
|
||
* Create a client and establish a connection to Ably with: | ||
* The Laravel Broadcaster an independent service provider library for [Laravel](https://laravel.com/) using [ably-php](https://github.com/ably/ably-php) | ||
* [Echo](https://github.com/ably-forks/laravel-echo), a Laravel Echo fork that adds native Ably integration for Laravel's real-time broadcasting features. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
real-time --> realtime 🙂
837dfc4
to
476b49a
Compare
476b49a
to
4d514db
Compare
0989ef1
to
0678395
Compare
Description
Laravel getting started guide for Pub/Sub. Using Laravel 12.