PHPackages                             laravel-notification-channels/webex - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. laravel-notification-channels/webex

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

laravel-notification-channels/webex
===================================

A Laravel Notification Channel for Webex.

v2.0.0(2y ago)128MITPHPPHP &gt;=8.1

Since Mar 4Pushed 2y ago4 watchersCompare

[ Source](https://github.com/laravel-notification-channels/Webex)[ Packagist](https://packagist.org/packages/laravel-notification-channels/webex)[ Docs](https://github.com/laravel-notification-channels/webex)[ RSS](/packages/laravel-notification-channels-webex/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (8)Versions (8)Used By (0)

Webex Notifications Channel for Laravel
=======================================

[](#webex-notifications-channel-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5f2d695ceefda0c27324e735c9516d5f09e711f8460a560ccbafef895ed4417f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f77656265782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/webex)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/5acbfce9cb54305ee8e3bcfde3d908621b78691f9e27843cea3ef2822f4c0095/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f77656265782f746573742e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265)](https://github.com/laravel-notification-channels/webex/actions/workflows/test.yml)[![Total Downloads](https://camo.githubusercontent.com/8dc6587c83e91b0c4193255b757936d76c706844643cc2e6ac059c0b00a3b15b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f77656265782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/webex)

This package makes it easy to send notifications using [Webex](https://www.webex.com/) with Laravel 10 and 11.

```
/**
 * Get the Webex Message representation of the notification.
 *
 * @return \NotificationChannels\Webex\WebexMessage
 *
 * @throws \NotificationChannels\Webex\Exceptions\CouldNotCreateNotification
 */
public function toWebex(mixed $notifiable)
{
    return (new WebexMessage)
        ->text('The message, in plain text.')
        ->markdown('# The message, in Markdown format.')
        ->file(function (WebexMessageFile $file) {
            $file->path('https://www.webex.com/content/dam/wbx/global/images/webex-favicon.png');
        });
}
```

Contents
--------

[](#contents)

- [Installation](#installation)
    - [Install the package using Composer](#install-the-package-using-composer)
    - [Add service configuration for Webex](#add-service-configuration-for-webex)
- [Usage](#usage)
    - [Formatting Webex Notifications](#formatting-webex-notifications)
        - [Plain Text Message](#plain-text-message)
        - [Rich Text Message](#rich-text-message)
        - [Replying to a Parent Message](#replying-to-a-parent-message)
        - [Including a File](#including-a-file)
        - [Including an Attachment](#including-an-attachment)
        - [Room/Space Linking](#roomspace-linking)
        - [User and Group Mentions](#user-and-group-mentions)
    - [Routing Webex Notifications](#routing-webex-notifications)
- [Available Methods](#available-methods)
    - [Webex Message Methods](#webex-message-methods)
    - [Webex Message File Methods](#webex-message-file-methods)
    - [Webex Message Attachment Methods](#webex-message-attachment-methods)
    - [Interface Method Implementations](#interface-method-implementations)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

Installation
------------

[](#installation)

To use this package, you need to add it as a dependency to your project and provide the necessary configuration.

### Install the package using Composer

[](#install-the-package-using-composer)

Pull in and manage the Webex notifications package easily with Composer:

```
composer require laravel-notification-channels/webex
```

### Add service configuration for Webex

[](#add-service-configuration-for-webex)

You will also need to include a Webex service configuration to your application. To do this, edit the `config/services.php` file, and add the following, or if the `webex` key already exists, merge:

```
'webex' => [
    'notification_channel_url' => env('WEBEX_NOTIFICATION_CHANNEL_URL', 'https://webexapis.com/v1/messages'),
    'notification_channel_id' => env('WEBEX_NOTIFICATION_CHANNEL_ID'),
    'notification_channel_token' => env('WEBEX_NOTIFICATION_CHANNEL_TOKEN')
],
```

Use the `WEBEX_NOTIFICATION_CHANNEL_ID` and `WEBEX_NOTIFICATION_CHANNEL_TOKEN`[environment variables](https://laravel.com/docs/10.x/configuration#environment-configuration)to define your Webex ID and Token. One way to get these values is by creating a new [Webex Bot](https://developer.webex.com/my-apps/new/bot).

Usage
-----

[](#usage)

If you are new to Laravel Notification, I highly recommend reading the official documentation which goes over the basics of [generating](https://laravel.com/docs/11.x/notifications#generating-notifications)and [sending](https://laravel.com/docs/11.x/notifications#sending-notifications) notifications. The guide below assumes that you have successfully generated a notification class with a [`via`](https://laravel.com/docs/11.x/notifications#specifying-delivery-channels)method whose return value includes `'webex'` or `NotificationChannels\Webex\WebexChannel::class`. For example:

```
