Download the PHP package stechstudio/slack-laravel-api without Composer

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

Slack Laravel API

Easily handle Slack web hook requests via Laravel style routing with Middleware authentication. If you have ever implemented a webhook for Slack, you're going to want to try this.

Versions and compatibility

Installation

Composer

Configuration

.env

On each HTTP request that Slack sends, they add an X-Slack-Signature HTTP header. The signature is created by combining the signing secret with the body of the request we're sending using a standard HMAC-SHA256 keyed hash.

It is this signing secret that is used by the middleware to authenticate the request:

Publish Slack Routes

Usage

After publishing the Slack Routes you can look in base('routes/slack.php') to find the API route and some working examples of Slack routes.

Web Route

By default, your application will have GET|POST|HEAD methods on the slack/api URI that will pass everything to STS\Slack\Http\Controllers\Slack@webhook via the slack middleware.

You may modify the URI or even add addition routes for other endpoints.

Slack Command Routes

These are working examples, and if you setup both Slack slash commands to use the configured URI, simply typing /hello or /echo yoodle will trigger the appropriate response.

The SlackRoute::handles() expects you to provide a command that matches the slash command in Slack, along with a Callable to handle the command.

This is best demonstrated in the Echo command sample.

First note that your Command must implement STS\Slack\Contracts\SlashCommands\ControllerI in order to be valid. This ensures that we have a handle() that takes a SlashCommand and returns a SlackMessage.

As you can see, the SlashCommand provides access to everything that Slack sends you. The two most commonly used will be:

Assume the user typed /echo yoodle ay e who into Slack to trigger this. Then getCommand() would return /echo and getText() returns yoodle ay e who. We often then parse the text for sub-commands.

The SlackMessage class is a fairly powerful wrapper around the Building Block message layout format specified by the Slack API. Anything you can do with the blocks, you can do with this class.

Conclusion

That's it, handle your command and return a Slack-formatted message with Laravel middleware authenticating each Slack call for you and some handy classes to make handling these things easier.


All versions of slack-laravel-api with dependencies

PHP Build Version
Package Version
Requires ext-intl Version *
guzzlehttp/psr7 Version ^1.8
php-http/curl-client Version ^2.2
jolicode/slack-php-api Version ^4.3
ramsey/uuid Version ^4.1
guzzlehttp/guzzle Version ^7.3
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 stechstudio/slack-laravel-api contains the following files

Loading the files please wait ....