Download the PHP package atatus/laravel-atatus without Composer
On this page you can find all versions of the php package atatus/laravel-atatus. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download atatus/laravel-atatus
More information about atatus/laravel-atatus
Files in atatus/laravel-atatus
Package laravel-atatus
Short Description Atatus PHP Middleware for Laravel
License Apache-2.0
Homepage https://www.atatus.com
Informations about the package laravel-atatus
Atatus Laravel Middleware
Atatus Laravel Middleware allows for the automatic capture of API calls and sends them to Atatus API analytics.
How to install
Via Composer
or add 'atatus/laravel-atatus' to your composer.json file accordingly.
How to use
Add Service Provider
Add to Middleware
If website root is your API, add to the root level:
If you only want to add tracking for APIs under specific route group, add to your route group, but be sure to remove from the global middleware stack from above global list.
To track only certain routes, use route specific middleware setup.
Publish the package config file
Setup config
Edit config/atatus.php
file.
For other configuration options, see below.
Configuration options
You can define Atatus configuration options in the config/atatus.php
file.
logBody
Type: Boolean
Optional, Default true, Set to false to remove logging request and response body to Atatus.
debug
Type: Boolean
Optional, Default false, Set to true to print debug messages using Illuminate\Support\Facades\Log
configClass
Type: String
Optional, a string for the full path (including namespaces) to a class containing additional functions.
The class can reside in any namespace, as long as the full namespace is provided.
example:
Configuration class (Optional)
Because configuration hooks and functions cannot be placed in the config/atatus.php
file, these reside in a PHP class that you create.
Set the path to this class using the configClass
option. You can define any of the following hooks:
identifyUserId
Type: ($request, $response) => String
Optional, a function that takes a $request and $response and return a string for userId. Atatus automatically obtains end userId via $request->user()['id'], In case you use a non standard way of injecting user into $request or want to override userId, you can do so with identifyUserId.
identifyCompanyId
Type: ($request, $response) => String
Optional, a function that takes a $request and $response and return a string for companyId.
maskRequestBody
Type: $body => $body
Optional, a function that takes a $body, which is an associative array representation of JSON, and
returns an associative array with any information removed.
maskResponseBody
Type: $body => $body
Optional, same as above, but for Responses.
Example config class
- In your
config/atatus.php
file:
Be sure to update cache after changing config:
If you enabled config cache, after you update the configuration, please be sure to run php artisan config:cache
again to ensure configuration is updated.
Credits
- Mixpanel's PHP client
- Moesif Laravel Middlware
- Jonny Pickett
The PHP JSON extension is required.
Make sure you install PHP with the JSON Extension enabled More Info.
All versions of laravel-atatus with dependencies
ext-curl Version *
ext-json Version *
ext-mbstring Version *
mashape/unirest-php Version ~3.0.1
apimatic/jsonmapper Version ~1.0.0