Download the PHP package tkrnx/laravel-teams-notifier without Composer

On this page you can find all versions of the php package tkrnx/laravel-teams-notifier. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-teams-notifier

Laravel Teams Notifier

A small Laravel package for sending structured, fail-safe notifications to a Microsoft Teams Workflow webhook. It builds compact Adaptive Cards, adds application and request metadata, redacts sensitive context, and keeps Teams outages from breaking the application that reported the event.

Features

Requirements

Installation

Install the package with Composer:

Laravel discovers the service provider and TeamsNotifier alias automatically. Publish the configuration if you need to customize it:

The explicit provider form is also supported:

Configuration

Add the Workflow URL and the settings appropriate for your application:

The published config/teams-notifier.php file also contains the sensitive-key list. Add application-specific secret field names there when needed.

Setting Default Purpose
enabled true Makes all notifier calls no-ops when disabled.
webhook_url null Microsoft Teams Workflow HTTP POST URL.
app_name APP_NAME Name displayed on every card.
environment APP_ENV Environment displayed on every card.
timeout 5 HTTP timeout in seconds.
include_debug false Includes a bounded exception trace. Keep disabled unless needed.
queue false Dispatches delivery to the application's default queue.
sensitive_keys See config Context keys whose values are recursively replaced with [REDACTED].

If notification delivery is enabled without a webhook URL, the package logs one warning per resolved webhook client and returns safely. The webhook URL itself is never included in package log messages.

Microsoft Teams Workflow Setup

Microsoft currently supports creating incoming webhooks through the Workflows app or from a channel/chat workflow template. The shortest setup is:

  1. In Teams, open the target channel or chat's More options, then select Workflows.
  2. Choose the appropriate Send webhook alerts to a channel/chat template.
  3. Authenticate the connection, choose the destination, and add the workflow.
  4. Copy the generated HTTP POST URL into TEAMS_NOTIFIER_WEBHOOK_URL.
  5. Send a test notification from the application.

You can also create a workflow from blank with the When a Teams webhook request is received trigger and a Post card in chat or channel action. Microsoft's Workflows webhook setup guide covers both paths. For operational continuity, add co-owners to production workflows because workflows are owned by users.

The package sends the documented type: message envelope with application/vnd.microsoft.card.adaptive attachments. Microsoft documents this payload and the 28 KB message limit in its Teams incoming webhook developer guide.

Treat the generated URL as a secret. Store it in environment or secret-management configuration; do not commit it.

Basic Usage

Import the package facade:

With Laravel's discovered alias, use TeamsNotifier; is also available.

INFO Notifications

WARNING Notifications

ERROR Notifications

Attach an exception when it adds useful diagnostic detail:

Delivery failures are caught and logged, so the notifier does not replace the original business exception.

Exception Notifications

The shortcut creates an ERROR notification and uses the exception's short class name as its default title:

Override the title when a business-specific name is clearer:

Dependency Injection

Use the contract when a service should not depend on the facade:

Context Data

Context can contain strings, integers, floats, booleans, null, arrays, enums, dates, stringable values, and objects. Keys such as reward_id are displayed as Reward ID. Arrays and objects are safely converted to compact JSON.

During HTTP requests, the package automatically includes:

The request body, authorization headers, cookies, and other headers are not collected.

Security and Sensitive Data

Sensitive keys are matched case-insensitively and recursively. The defaults are:

For example, both password and a nested Access_Token become [REDACTED]. Normal context strings are bounded to 2,000 characters, exception messages are bounded to 4,000 characters, debug traces are bounded to 8,000 characters, collection size and depth are capped, and the builder applies a final card text budget.

Full traces can reveal internal paths or values. TEAMS_NOTIFIER_INCLUDE_DEBUG is therefore false by default. Never put secrets in titles or exception messages; key-based redaction applies to context data.

Queue Support

Set queued delivery in production when the main request should not wait for Teams:

Run a Laravel queue worker using your application's normal queue configuration:

The queued job receives only scalar/array notification data. Exceptions are normalized to class, message, file, line, and an optional bounded trace before dispatch; raw Throwable objects are never serialized. The job allows one attempt and does not create another Teams alert when Teams delivery fails.

Failure Behavior

HTTP requests use Laravel's HTTP client, the configured short timeout, and two total attempts separated by 200 milliseconds. Non-success responses and transport exceptions are logged as warnings with only safe metadata such as status code or exception class. They are not thrown into application code.

Disable all HTTP and queue activity at runtime with:

Testing

The HTTP transport works with Laravel's normal HTTP fake:

Run the package checks locally:

The suite uses Orchestra Testbench and covers the facade, service provider, all levels, exception helper, request context, recursive redaction, card structure, payload size, disabled mode, missing webhooks, HTTP failures, queue dispatch, and queued delivery.

License

Laravel Teams Notifier is open-sourced software licensed under the MIT license.


All versions of laravel-teams-notifier with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^11.0 || ^12.0
illuminate/http Version ^11.0 || ^12.0
illuminate/queue Version ^11.0 || ^12.0
illuminate/support Version ^11.0 || ^12.0
psr/log Version ^2.0 || ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tkrnx/laravel-teams-notifier contains the following files

Loading the files please wait ...