Skip to content

Conversation

GregHolmes
Copy link
Contributor

@GregHolmes GregHolmes commented Jul 22, 2025

Description

Laravel getting started guide for Pub/Sub. Using Laravel 12.

Copy link

coderabbitai bot commented Jul 22, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch EDU-1984-Create-Laravel-getting-started-guide

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@GregHolmes GregHolmes force-pushed the EDU-1984-Create-Laravel-getting-started-guide branch from 8f75a8f to bd8ce26 Compare July 22, 2025 13:52
@GregHolmes GregHolmes self-assigned this Jul 22, 2025
@GregHolmes GregHolmes added the review-app Create a Heroku review app label Jul 22, 2025
@GregHolmes GregHolmes requested review from sacOO7 and m-hulbert July 22, 2025 13:52
@ably-ci ably-ci temporarily deployed to ably-docs-edu-1984-crea-csiibz July 22, 2025 13:52 Inactive
@GregHolmes GregHolmes changed the title Edu 1984 create laravel getting started guide [EDU-1984] - Create Laravel getting started guide Jul 22, 2025
@GregHolmes GregHolmes force-pushed the EDU-1984-Create-Laravel-getting-started-guide branch from bd8ce26 to 327b2ea Compare July 24, 2025 13:06
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-1984-crea-csiibz July 24, 2025 13:07 Inactive
@GregHolmes GregHolmes had a problem deploying to ably-docs-edu-1984-crea-csiibz July 24, 2025 13:17 Failure
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-1984-crea-csiibz July 24, 2025 13:27 Inactive
@GregHolmes GregHolmes force-pushed the EDU-1984-Create-Laravel-getting-started-guide branch from 1bd0528 to 962aecb Compare July 28, 2025 11:24
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-1984-crea-csiibz July 28, 2025 11:25 Inactive
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-1984-crea-csiibz July 28, 2025 11:44 Inactive
```
</Code>

## Step 6: Create a frontend file to listen for events <a id="step-6"/>
Copy link
Contributor

@sacOO7 sacOO7 Jul 30, 2025

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.

Copy link
Contributor

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.

Copy link
Contributor

@sacOO7 sacOO7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,484 @@
---
title: "Getting started: Pub/Sub in Laravel"
Copy link
Contributor

@sacOO7 sacOO7 Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 : |

Copy link
Contributor

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.

Comment on lines 478 to 482
* 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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)

@GregHolmes GregHolmes force-pushed the EDU-1984-Create-Laravel-getting-started-guide branch 2 times, most recently from 18f4968 to 5753ca8 Compare August 28, 2025 11:26
@m-hulbert m-hulbert added review-app Create a Heroku review app and removed review-app Create a Heroku review app labels Aug 29, 2025
@ably-ci ably-ci temporarily deployed to ably-docs-edu-1984-crea-ixnwiz August 29, 2025 09:01 Inactive

It will take you through the following steps:

* Create a client and establish a connection to Ably with the Laravel Broadcaster and Echo.
Copy link
Contributor

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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:
Copy link
Contributor

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:
Copy link
Contributor

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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.

Copy link
Contributor

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.

@GregHolmes GregHolmes force-pushed the EDU-1984-Create-Laravel-getting-started-guide branch from 0151268 to fbaeff6 Compare September 1, 2025 12:46
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-1984-crea-ixnwiz September 1, 2025 12:46 Inactive
@GregHolmes GregHolmes requested a review from m-hulbert September 1, 2025 12:57
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-1984-crea-ixnwiz September 1, 2025 12:57 Inactive
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-1984-crea-ixnwiz September 3, 2025 10:11 Inactive
Copy link
Contributor

@m-hulbert m-hulbert left a 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

real-time --> realtime 🙂

@GregHolmes GregHolmes force-pushed the EDU-1984-Create-Laravel-getting-started-guide branch from 837dfc4 to 476b49a Compare September 4, 2025 11:55
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-1984-crea-ixnwiz September 4, 2025 11:55 Inactive
@GregHolmes GregHolmes force-pushed the EDU-1984-Create-Laravel-getting-started-guide branch from 476b49a to 4d514db Compare September 4, 2025 12:34
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-1984-crea-ixnwiz September 4, 2025 12:34 Inactive
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-1984-crea-ixnwiz September 4, 2025 12:37 Inactive
@GregHolmes GregHolmes force-pushed the EDU-1984-Create-Laravel-getting-started-guide branch from 0989ef1 to 0678395 Compare September 4, 2025 12:38
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-1984-crea-ixnwiz September 4, 2025 12:38 Inactive
@GregHolmes GregHolmes merged commit 0dfe7ea into main Sep 4, 2025
6 checks passed
@GregHolmes GregHolmes deleted the EDU-1984-Create-Laravel-getting-started-guide branch September 4, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review-app Create a Heroku review app
Development

Successfully merging this pull request may close these issues.

4 participants