PHP code example of hanoii / platformsh2slack

1. Go to this page and download the library: Download hanoii/platformsh2slack 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/ */

    

hanoii / platformsh2slack example snippets




// Optional settings
$settings = [
  'channel' => '#random',
  'project' => 'Some project',
  // Environment will be appended to the URL
  'project_url' => 'https://console.platform.sh/USER/PROJECTID',
];

$platformsh2slack = new Hanoii\Platformsh2Slack\Platformsh2Slack(
  'https://hooks.slack.com/...',
  $settings
);

// Optionally protect the request with a token that has to be present in the Platform.sh webhook
$platformsh2slack->validateToken('1234');

// Send the information to slack
$platformsh2slack->send();

$platformsh2slack->validateToken('1234');
bash
platform integration:add --type=webhook --url="https://www.example.com/platformsh2slack.php?token=TOKEN"