New to PHP. Trying to implement a simple Slack integration using Laravel.
Successfully added alek13/slack
following instructions here and confirmed it's in my project's composer.json
file. According to the guidance:
Quick Tour
- create an incoming webhook & copy hook_url
composer require alek13/slack
- add the following code
use Maknz\Slack\Client;
require(__DIR__ .'/vendor/autoload.php');
$client = new Client('https://hook_url');
$client->to('#general')->send('Good morning');
Done!
While this may be obvious to PHP veterans, I am unable to gather from the documentation any reference as to exactly into which file the sample code above should be inserted. (e.g., ./vendor/autoload.php
? ./config/...
?, etc.)
Any guidance is appreciated!