PHP code example of tkrnx / laravel-teams-notifier
1. Go to this page and download the library: Download tkrnx/laravel-teams-notifier 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/ */
tkrnx / laravel-teams-notifier example snippets
use Tkrnx\LaravelTeamsNotifier\Facades\TeamsNotifier;
TeamsNotifier::info(
title: 'Order Created',
message: 'A new order has been created.',
context: [
'order_id' => 123,
'total' => 1500,
],
);
use Tkrnx\LaravelTeamsNotifier\Contracts\TeamsNotifierContract;
final class ProcessEntity
{
public function __construct(
private readonly TeamsNotifierContract $notifier,
) {}
public function handle(): void
{
$this->notifier->info('Entity Processed');
}
}
use Illuminate\Support\Facades\Http;
use Tkrnx\LaravelTeamsNotifier\Facades\TeamsNotifier;
Http::fake([
'*' => Http::response('', 202),
]);
TeamsNotifier::info('Test Notification');
Http::assertSentCount(1);