PHP code example of sreedev / laravel-slack

1. Go to this page and download the library: Download sreedev/laravel-slack library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sreedev / laravel-slack example snippets

 
composer 

php artisan vendor:publish --provider="Sreedev\Slack\SlackServiceProvider" --tag="config"
 
use Sreedev\Slack\Facades\Slack
 
Slack::chat('postMessage',$argsArray)

//to a channel
Slack::chat('postMessage',['channel'=>'#channel_name', 'text'=>'Message to be send');

//to a user
Slack::chat('postMessage',['channel'=>'@username', 'text'=>'Message to be send');