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

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

Stand With Ukraine

Laravel Slack Notifier

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Send exceptions and dump variables to Slack.

Installation

Install the package via composer:

All env variables used by this package (only LOG_SLACK_WEBHOOK_URL is required):

How to get a webhook URL in the Slack API docs.

To temporarily disable all logging, simply comment out LOG_SLACK_WEBHOOK_URL or set it to an empty string or null.

Optionally publish the config file with:

Usage

To send a message to Slack, simply call SlackNotifier::send().

Report Exception

Dump Variable

Using multiple webhooks

Use an alternative webhook, by specify extra ones in the config file.

The webhook to be used can be chosen using the to function.

Using a custom webhooks

The to function also supports custom webhook URLs.

Sending message to another channel

You can send a message to a channel (use LOG_SLACK_CHANNEL) other than the default one for the webhook, by passing it to the channel function.

Slack bot customizing

Use username (use APP_NAME) and emoji (use LOG_SLACK_EMOJI) to make your messages unique, or override them right before sending.

Formatting

Extend the default Stasadev\SlackNotifier\SlackNotifierFormatter::class to format the messages however you like. Then simply replace the formatter key in the configuration file.

Additional context in the message

Include additional context in a Slack message (use dont_flash to exclude sensitive info from context). It will be added as an attachment.

Exception stack trace filtering

Stack traces for exceptions in Laravel usually contain many lines, including framework files. Usually, you are only interested in tracking exception details in the application files. You can filter it out with the dont_trace config option.

Caching the same exceptions

Sometimes a large group of exceptions is thrown, and you don't want to log each of them because they are the same.

Use LOG_SLACK_CACHE_SECONDS (uses Laravel cache under the hood) to suppress output for X seconds, or pass it to the cacheSeconds function.

Testing

Credits

Inspired by spatie/laravel-slack-alerts.

License

The MIT License (MIT). Please see License File for more information.


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 stasadev/laravel-slack-notifier contains the following files

Loading the files please wait ....