1. Go to this page and download the library: Download atatus/laravel-atatus 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/ */
atatus / laravel-atatus example snippets
// In config/app.php
'providers' => [
/*
* Application Service Providers...
*/
Atatus\Middleware\AtatusLaravelServiceProvider::class,
];
// In App/Http/Kernel.php
protected $middleware = [
/*
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*/
\Atatus\Middleware\AtatusLaravel::class,
];
// In App/Http/Kernel.php
protected $middlewareGroups = [
/**
* The application's API route middleware group.
*/
'api' => [
//
\Atatus\Middleware\AtatusLaravel::class,
],
];
namespace MyApp\MyConfigs;
class CustomAtatusConfig
{
public function maskRequestBody($body) {
return $body;
}
public function maskResponseBody($body) {
return $body;
}
public function identifyUserId($request, $response) {
if (is_null($request->user())) {
return null;
} else {
$user = $request->user();
return $user['id'];
}
}
public function identifyCompanyId($request, $response) {
return "comp_acme_corporation";
}
}