PHP code example of zanysoft / laravel-teams-logging

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

    

zanysoft / laravel-teams-logging example snippets


ZanySoft\LaravelTeamsLogging\LoggerServiceProvider::class,

$app->register(
    ZanySoft\LaravelTeamsLogging\LoggerServiceProvider::class
);

$app->configure('teams');

'teams' => [
    'driver' => 'custom',
    'via'    => ZanySoft\LaravelTeamsLogging\LoggerChannel::class,
    'level'  => 'debug',
    'url'    => env('TEAMS_WEBHOOK_URL')
],

Log::channel('teams')->error('Something went wrong.');

Log::channel('teams')->error(
    'Unable to process payment.',
    [
        'order_id' => 1452,
        'customer' => 'John Doe',
    ]
);

Log::channel('teams')->error('Something went wrong.');

Log::channel('teams')->error(
    'Unable to process payment.',
     [
        'name'  => 'value',
        'order_id' => 1452,
        'amount'   => 49.99,
     ]
);

'channels' => [
    'stack' => [
        'driver' => 'stack',
        'channels' => [
            'single',
            'teams',
        ],
    ],
],
bash
php artisan vendor:publish --provider="ZanySoft\LaravelTeamsLogging\LoggerServiceProvider"