PHP code example of marchie / ms-application-insights-laravel

1. Go to this page and download the library: Download marchie/ms-application-insights-laravel 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/ */

    

marchie / ms-application-insights-laravel example snippets


'providers' => [
	...
	Marchie\MSApplicationInsightsLaravel\Providers\MSApplicationInsightsServiceProvider::class,
	...
]

'aliases' => [
	...
	'AIClient' => Marchie\MSApplicationInsightsLaravel\Facades\MSApplicationInsightsClientFacade::class,
	'AIServer' => Marchie\MSApplicationInsightsLaravel\Facades\MSApplicationInsightsServerFacade::class,
	...
]


protected $middleware = [
	...
	'MSApplicationInsightsMiddleware',
	...
]


...

# Delete this line
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

# Insert this line
use Marchie\MSApplicationInsightsLaravel\Handlers\MSApplicationInsightsExceptionHandler as ExceptionHandler;

...

{!! AIClient::javascript() !!}

...
AIServer::trackEvent('Test event');
AIServer::flush();
...