PHPackages                             sevaske/laravel-discourse - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sevaske/laravel-discourse

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sevaske/laravel-discourse
=========================

2.1.0(7mo ago)020MITPHPPHP ^8.1

Since Sep 25Pushed 7mo agoCompare

[ Source](https://github.com/sevaske/laravel-discourse)[ Packagist](https://packagist.org/packages/sevaske/laravel-discourse)[ RSS](/packages/sevaske-laravel-discourse/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (9)Versions (6)Used By (0)

Laravel Discourse
=================

[](#laravel-discourse)

[![Packagist](https://camo.githubusercontent.com/b86e1fd5945d1a33f3b25d2462308eabedf6a4da130e92de8d7053113a80c689/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73657661736b652f6c61726176656c2d646973636f757273652e737667)](https://packagist.org/packages/sevaske/laravel-discourse)[![License](https://camo.githubusercontent.com/e71dec77e32c512e83e7e6356000d0e6d4941724d09b5eb953c03a5a736e18f9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f73657661736b652f6c61726176656c2d646973636f757273652e737667)](LICENSE)

**Laravel wrapper for [sevaske/discourse](https://github.com/sevaske/discourse).**
This package provides simple integration of Discourse API and SSO (Single Sign-On) into your Laravel application.
For a full list of available API endpoints and features, see the core [sevaske/discourse](https://github.com/sevaske/discourse) package.

✨ Features
----------

[](#-features)

- 🔑 **Discourse Connect (SSO)**

    - Full support for [Discourse SSO](https://meta.discourse.org/t/official-single-sign-on-for-discourse-sso/13045): signing and validating payloads.
    - Built-in `SsoController`, fully configurable via `.env`:
        - `DISCOURSE_SSO_ENABLED` — enable/disable the SSO route.
        - `DISCOURSE_SSO_URI` — the route path (default: `/discourse/sso`).
        - `DISCOURSE_SSO_CONTROLLER` — controller class handling the request.
        - `DISCOURSE_SSO_MIDDLEWARE` — comma-separated list of middleware (default: `web, auth, discourse.sso.signature`).
    - Middleware:
        - `discourse.sso.signature` — validates the incoming SSO signature.
- 📡 **Webhooks**

    - Enable via `.env` or config file:
        - `DISCOURSE_WEBHOOKS_ENABLED` — enable/disable webhook route.
        - `DISCOURSE_WEBHOOKS_SECRET` — secret for signature validation.
        - `DISCOURSE_WEBHOOKS_URI` — the route path (default: `/discourse/webhook`).
        - `DISCOURSE_WEBHOOKS_CONTROLLER` — controller class handling the request.
        - `DISCOURSE_WEBHOOKS_MIDDLEWARE` — comma-separated list of middleware (default: `discourse.webhook.signature`).
    - Dispatches `DiscourseWebhookReceived` event with:
        - `eventName`, `eventType`, `eventId`, and `payload`.
- 📡 **API client integration**

    - Access the full Discourse API through `$discourse->api()`.
    - Covers categories, users, posts, groups, private messages, webhooks, and more.
    - Automatically signs requests with your API key and username.
- ⚡ **Laravel-ready**

    - Service Provider auto-registration.
    - Facade `Discourse` for clean syntax.
    - Middleware aliases registered automatically.
- 🧩 **Built on top of [`sevaske/discourse`](https://github.com/sevaske/discourse)**

    - All low-level functionality extracted into a framework-agnostic core package.
    - This wrapper adds Laravel integration, convenience, and conventions.

📦 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require sevaske/laravel-discourse
```

⚙️ Configuration
----------------

[](#️-configuration)

Publish the config file:

```
php artisan vendor:publish --tag="discourse-config"
```

It creates the config file `config/discourse.php`:

```
