PHP code example of margatampu / laravel-teams-logging

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

    

margatampu / laravel-teams-logging example snippets


MargaTampu\LaravelTeamsLogging\LoggerServiceProvider::class

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

$app->configure('teams');

'teams' => [
    'driver'    => 'custom',
    'via'       => \MargaTampu\LaravelTeamsLogging\LoggerChannel::class,
    'level'     => 'debug',
    'url'       => env('INCOMING_WEBHOOK_URL'),
    'style'     => 'simple',    // Available style is 'simple' and 'card', default is 'simple'
],

'teams' => [
    'driver'    => 'custom',
    'via'       => \MargaTampu\LaravelTeamsLogging\LoggerChannel::class,
    'level'     => 'debug',
    'url'       => env('INCOMING_WEBHOOK_URL'),
    'style'     => 'simple',    // Available style is 'simple' and 'card', default is 'simple'
    'name'      => 'Dummy Project'
],

Log::channel('teams')->error('Error message');

Log::channel('teams')->error('Error message', [
    'name'  => 'value',
    'Assigned to' => 'Unassigned'
]);

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