PHP code example of joelhinz / laravel-quick-slack

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

    

joelhinz / laravel-quick-slack example snippets


'providers' => [
    // ...
    JoelHinz\LaravelQuickSlack\ServiceProvider::class,
],

'aliases' => [
    // ...
    'QuickSlack' => JoelHinz\LaravelQuickSlack\Facade::class,
],

use QuickSlack;

QuickSlack::to($webhook)->send('My hovercraft is full of eels.');

# Remember webhook for next call
QuickSlack::to($webhook, true)->send('My nipples explode with delight!');

# No need for the to() method this time
QuickSlack::send('I cannot wait till lunchtime.');

# Set a new webhook - the new webhook will now be remembered instead
QuickSlack::to($webhook)->send('Drop your panties, Sir William!');

# Set a new webhook but stop remembering
QuickSlack::to($webhook, false)->send('Bouncy-bouncy');

# Stop remembering without sending a message
QuickSlack::forgetRecipient();

QuickSlack::send('first message')->send('second message')->send('third message');



return [
    /**
     * Set names for your webhooks.
     */
    'webhooks' => [
        'my-webhook' => 'some-webhook-url',
    ],

    /**
     * Set a default webhook to use if no other url is given explicitly.
     * This can be either a webhook url, or the name of a named webhook above.
     */
    'default' => '',
];

QuickSlack::to('my-webhook')->send('I will not buy this record, it is scratched.');

'webhooks' => [
    'email bounces' => 'https://hooks.slack.com/services/...',
    'email complaints' => 'email bounces',
]
bash
php artisan vendor:publish --provider="JoelHinz\LaravelQuickSlack\ServiceProvider"