{"id":20770591,"url":"https://github.com/ably/ably-php-laravel","last_synced_at":"2025-08-22T03:31:39.645Z","repository":{"id":9710647,"uuid":"62727630","full_name":"ably/ably-php-laravel","owner":"ably","description":"PHP Laravel framework client library SDK for Ably realtime messaging service","archived":false,"fork":false,"pushed_at":"2024-03-13T02:30:25.000Z","size":87,"stargazers_count":28,"open_issues_count":2,"forks_count":8,"subscribers_count":26,"default_branch":"main","last_synced_at":"2024-09-19T09:48:57.719Z","etag":null,"topics":["client-library","laravel","php","sdk"],"latest_commit_sha":null,"homepage":"https://ably.com/download","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ably.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-06T14:31:59.000Z","updated_at":"2024-09-18T09:24:18.000Z","dependencies_parsed_at":"2024-06-19T05:32:26.821Z","dependency_job_id":"0caaf13a-643f-4ff8-9cba-b7edd8bcd5dc","html_url":"https://github.com/ably/ably-php-laravel","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ably%2Fably-php-laravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ably%2Fably-php-laravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ably%2Fably-php-laravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ably%2Fably-php-laravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ably","download_url":"https://codeload.github.com/ably/ably-php-laravel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230554330,"owners_count":18244234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client-library","laravel","php","sdk"],"created_at":"2024-11-17T12:10:42.217Z","updated_at":"2025-08-22T03:31:39.639Z","avatar_url":"https://github.com/ably.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Ably Pub/Sub PHP Laravel Header](images/LaraVELSDK-github.png)\n[![Latest Stable Version](https://poser.pugx.org/ably/ably-php-laravel/v/stable)](https://packagist.org/packages/ably/ably-php-laravel)\n[![License](https://poser.pugx.org/ably/ably-php-laravel/license)](https://github.com/ably/ably-php-laravel/blob/main/LICENSE)\n\n---\n\n# Ably Pub/Sub PHP Laravel SDK\n\nBuild using Ably’s Pub/Sub PHP Laravel SDK, supported on all popular platforms and frameworks.\n\nThis Laravel package provides a clean integration with the [Ably PHP](https://github.com/ably/ably-php) SDK. It includes a Facade and an injectable `AblyService` that wrap a singleton Ably instance, with configuration automatically loaded from your environment variables or config files. Additionally, the `AblyFactory` class lets you create new Ably instances with custom parameters when needed.\n\nThis SDK provides REST-only functionality for Laravel. For full-featured Laravel integration including real-time capabilities, Ably recommend using [Ably's Laravel Broadcaster](https://github.com/ably/laravel-broadcaster).\n\nAbly Pub/Sub provides flexible APIs that deliver features such as pub-sub messaging, message history, presence, and push notifications. Utilizing Ably’s realtime messaging platform, applications benefit from its highly performant, reliable, and scalable infrastructure.\n\nFind out more:\n\n* [Ably Pub/Sub docs.](https://ably.com/docs/basics)\n* [Ably Pub/Sub examples.](https://ably.com/examples?product=pubsub)\n\n---\n\n## Getting started\n\nEverything you need to get started with Ably:\n\n* [Getting started in Pub/Sub using PHP.](https://ably.com/docs/getting-started/php?lang=php)\n* [SDK Setup for PHP.](https://ably.com/docs/getting-started/setup?lang=php)\n\n---\n\n## Supported platforms\n\nAbly aims to support a wide range of platforms. If you experience any compatibility issues, open an issue in the repository or contact [Ably support](https://ably.com/support).\n\nThe PHP client library currently targets the [Ably 1.1 client library specification](https://www.ably.com/docs/client-lib-development-guide/features/).\n\n\u003e [!NOTE]\n\u003e See [laravel-broadcaster](https://packagist.org/packages/ably/laravel-broadcaster/), if you're using Laravel and want to support Realtime broadcasting and events.\n\n\u003e [!IMPORTANT]\n\u003e PHP SDK versions \u003c 1.1.9 will be [deprecated](https://ably.com/docs/platform/deprecate/protocol-v1) from November 1, 2025.\n\n---\n\n## Installation\n\nInstall the package using [Composer](https://getcomposer.org/):\n\n```bash\ncomposer require ably/ably-php-laravel\n```\n\nAdd the service provider in `config/app.php` to the `providers` array.\n\n```php\nAbly\\Laravel\\AblyServiceProvider::class\n```\n\nOptionally add a reference to the facade in `config/app.php` to the `aliases` array.\n\n```php\n'Ably' =\u003e Ably\\Laravel\\Facades\\Ably::class\n```\n---\n\n### Configuration\n\nAfter registering the service provider, publish the configuration file using Artisan:\n\n```bash\nphp artisan vendor:publish\n```\n\nUpdate the created file `config/ably.php` with your key or [other options](https://www.ably.com/docs/rest/usage#client-options). You can also set the key using an environment variable named `ABLY_KEY`.\n\n## Usage\n\nThe following sections demonstrates two ways to use Ably in Laravel: via a [Facade](#facade) or through [dependency injection](#dependency-injection).\n\n## Facade\n\nUse the Laravel facade to access the Ably client.\n\n\u003cdetails\u003e\n\u003csummary\u003eFacade usage details.\u003c/summary\u003e\n\nThe facade always returns a singleton instance created with options defined in the config file. Any methods available on an AblyRest class are available through the facade. Due to PHP limitations, properties must be accessed as methods, for example `Ably::auth()`):\n\n```php\nuse Ably;\n\necho Ably::time(); // 1467884220000\n$token = Ably::auth()-\u003erequestToken([ 'clientId' =\u003e 'client123', ]); // Ably\\Models\\TokenDetails\nAbly::channel('testChannel')-\u003epublish('testEvent', 'testPayload', 'testClientId');\n```\n\u003c/details\u003e\n\n## Dependency injection\n\nUse the dependency injection to access the Ably client.\n\n\u003cdetails\u003e\n\u003csummary\u003eDependency injection usage details.\u003c/summary\u003e\n\nYou can use `Ably\\Laravel\\AblyService` instead of the facade, which acts as a 1:1 wrapper for an AblyRest singleton instance created with default options. `Ably\\Laravel\\AblyFactory` lets you instantiate new AblyRest instances with (optional) custom options.\n\n```php\nuse Ably\\Laravel\\AblyService;\nuse Ably\\Laravel\\AblyFactory;\n\nfunction ablyExamples(AblyService $ably, AblyFactory $ablyFactory) {\n\techo $ably-\u003etime(); // 1467884220000\n\techo $ably-\u003eauth-\u003eclientId; // null\n\t$tokenDetails = $ably-\u003eauth-\u003erequestToken([ 'clientId' =\u003e 'client123', ]); // Ably\\Models\\TokenDetails\n\t$ably-\u003echannel('testChannel')-\u003epublish('testEvent', 'testPayload', 'testClientId');\n\n\t$ablyClient = $ablyFactory-\u003emake([ 'tokenDetails' =\u003e $tokenDetails ]);\n\techo $ablyClient-\u003eauth-\u003eclientId; // 'client123'\n}\n```\n\u003c/details\u003e\n\n---\n\n## Releases\n\nThe [CHANGELOG.md](CHANGELOG.md) contains details of the latest releases for this SDK. You can also view all Ably releases on [changelog.ably.com](https://changelog.ably.com).\n\n---\n\n## Contributing\n\nRead the [CONTRIBUTING.md](./CONTRIBUTING.md) guidelines to contribute to Ably.\n\n---\n\n## Support, feedback, and troubleshooting\n\nFor help or technical support, visit the [Ably Support page](https://ably.com/support).\n\n### Ably REST API\n\nThis SDK currently supports only the [Ably REST API](https://www.ably.com/docs/rest). If you need to subscribe to realtime events in PHP, consider using the [MQTT adapter](https://www.ably.com/docs/mqtt) to leverage [Ably's Realtime features](https://www.ably.com/docs/realtime).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fably%2Fably-php-laravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fably%2Fably-php-laravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fably%2Fably-php-laravel/lists"}