Download the PHP package nguyenanhung/slack without Composer

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

Slack

Latest Stable Version Total Downloads Daily Downloads Monthly Downloads License PHP Version Require

A simple PHP package for sending messages to Slack with incoming webhooks, focussed on ease-of-use and elegant syntax. Includes Laravel 4 and 5 support out of the box.

Requirements

Version

Installation

You can install the package using the Composer package manager. You can install it by running this command in your project root:

Then create an incoming webhook on your Slack account for the package to use. You'll need the webhook URL to instantiate the client (or for the configuration file if using Laravel).

Laravel

We include service providers and a facade for easy integration and a nice syntax for Laravel.

Firstly, add the nguyenanhung\Slack\SlackServiceProvider provider to the providers array in config/app.php (or app/config.php for Laravel 4)

and then add the facade to your aliases array

Configuration

Publish the configuration file with:

Head into the file and configure the defaults you'd like the package to use. If null is set for any, the package will fall back on the default set on the webhook.

The configuration file is used to bypass the client instantiation process to make using the package easier. Therefore, you can skip the the Instantiate the client section below and dive right into using the package.

Basic Usage

Instantiate the client

Settings

All settings are optional, but are a convenient way of specifying how the client should behave beyond the defaults.

Sending messages

To send messages, you will call methods on your client instance, or use the Slack facade if you are using the package in Laravel.

Sending a basic message

Sending a message to a non-default channel

Sending a message to a user

Sending a message to a channel as a different username

Sending a message with a different icon

Send an attachment

Send an attachment with fields

Send a message modifying Markdown parsing on the fly

Send an attachment specifying Markdown parsing on the fly

Send an attachment with an author

Advanced usage

Explicit message creation

For convenience, message objects are created implicitly by calling message methods on the client. We can however do this explicitly to avoid hitting the magic method.

Attachments

When using attachments, the easiest way is to provide an array of data as shown in the examples, which is actually converted to an Attachment object under the hood. You can also attach an Attachment object to the message:

Each attachment field is also an object, an AttachmentField. They can be used as well instead of their data in array form:

You can also set the attachments and fields directly if you have a whole lot of them:

Contributing

If you're having problems, spot a bug, or have a feature suggestion, please log and issue on Github. If you'd like to have a crack yourself, fork the package and make a pull request. Please include tests for any added or changed functionality. If it's a bug, include a regression test.


All versions of slack with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
guzzlehttp/guzzle Version ^7.4.3 || ^6.5.6
ext-mbstring Version *
ext-json Version *
ext-curl Version *
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 nguyenanhung/slack contains the following files

Loading the files please wait ....