Download the PHP package yuki777/slack without Composer

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

A simple PHP package for sending messages to Slack with incoming webhooks, focused on ease-of-use and elegant syntax.

Latest Stable Version Latest Unstable Version License

Total Downloads Monthly Downloads Daily Downloads

Build Status Scrutinizer Code Quality Code Climate Coverage Status

This repository started from a fork of the popular maknz/slack library, which is not maintained anymore.

The 1.x branch and all the related releases are an exact copy of the original repository and are under the BSD 2-clause "Simplified" License.

The next releases will be under the MIT license. See the current LICENSE file for more details.

Requirements

Installation

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

Why php-http/guzzle6-adapter? We are decoupled from any HTTP messaging client thanks to HTTPlug.

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).

Basic Usage

Instantiate the client

Settings

The default settings are pretty good, but you may wish to set up default behaviour for your client to be used for all messages sent. All settings are optional and you don't need to provide any. Where not provided, we'll fallback to what is configured on the webhook integration, which are managed at Slack, or our sensible defaults.

Field Type Description
channel string The default channel that messages will be sent to
sticky_channel bool If set to true, all messages will be sent to the default channel only (defaults to false). It can be useful for dev/test environments.
username string The default username for your bot
icon string The default icon that messages will be sent with, either :emoji: or a URL to an image
link_names bool Whether names like @regan or #accounting should be linked in the message (defaults to false)
unfurl_links bool Whether Slack should unfurl text-based URLs (defaults to false)
unfurl_media bool Whether Slack should unfurl media-based URLs, like tweets or Youtube videos (defaults to true)
allow_markdown bool Whether markdown should be parsed in messages, or left as plain text (defaults to true)
markdown_in_attachments array Which attachment fields should have markdown parsed (defaults to none)

Sending messages

Sending a basic message (preview)

Sending a message to a non-default channel

Sending a message to a user

Sending a message to a channel as a different bot name (preview)

Sending a message with a different icon (preview)

Send an attachment (preview)

Send an attachment with fields (preview)

Send an attachment with an author (preview)

Advanced usage

Markdown

By default, Markdown is enabled for message text, but disabled for attachment fields. This behaviour can be configured in settings, or on the fly:

Send a message enabling or disabling Markdown

Send an attachment specifying which fields should have Markdown enabled

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:

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.1
ext-mbstring Version *
php-http/client-common Version ^1.9 || ^2.0
php-http/discovery Version ^1.3
php-http/guzzle6-adapter Version ^2.0
symfony/options-resolver Version ^3.4 || ^4.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 yuki777/slack contains the following files

Loading the files please wait ....