Download the PHP package jmrashed/laravel-slack-notifier without Composer

On this page you can find all versions of the php package jmrashed/laravel-slack-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-slack-notifier

Laravel Slack Notifier Package

A simple package to send notifications to Slack using webhooks, with support for customizations such as multiple webhooks, channels, bot name, emojis, and more.

Table of Contents

Installation

To install the package, run the following composer command:

Configuration

Once the package is installed, you need to set up the environment variables for the Slack webhook and other configuration options.

Add the following entries to your .env file:

To temporarily disable notifications, either comment out or set the LOG_SLACK_WEBHOOK_URL to an empty string or null.

Optionally, you can publish the config file with the following Artisan command:

Usage

Send Message

To send a message to Slack, use the following code:

You can also send exceptions:

Report Exceptions

To automatically report exceptions to Slack, configure your Laravel exception handler.

Laravel 11.x and later

In bootstrap/app.php:

Laravel 8.x, 9.x, and 10.x

In app/Exceptions/Handler.php:

Laravel 7.x

In app/Exceptions/Handler.php:

Laravel 5.x, 6.x

In app/Exceptions/Handler.php:

Dump Variables

You can also send variables (strings, arrays, objects) to Slack:

Multiple Webhooks

You can configure multiple webhook URLs in the config/slack-notifier.php file:

To use a specific webhook, specify the webhook name:

Send Message to Another Channel

To send a message to a different Slack channel, use the channel method:

Customize Slack Bot

You can customize the bot’s name and emoji:

Message Formatting

If you need to format the message before sending, extend the default SlackNotifierFormatter class:

Additional Context

You can include additional context in the message. Use the context method to pass additional information as an attachment in the message.

Exception Stack Trace Filtering

Filter out unnecessary stack trace lines (e.g., from framework files) by configuring the dont_trace option in the config.

Cache Same Exceptions

To avoid logging the same exception multiple times, use the LOG_SLACK_CACHE_SECONDS configuration. It defines how long exceptions will be cached before being logged again.

Alternatively, you can specify the cache duration programmatically:

Testing

To run the tests for this package, use the following command:

License

This package is licensed under the MIT License. See the License File for more details.


All versions of laravel-slack-notifier with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.3 || ^8.0
ext-json Version *
laravel/slack-notification-channel Version ^1.0 || ^2.0 || ^3.0
monolog/monolog Version ^1.12 || ^2.0 || ^3.0
symfony/polyfill-php80 Version ^1.20
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 jmrashed/laravel-slack-notifier contains the following files

Loading the files please wait ....