PHPackages                             techies-africa/laravel\_trakker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. techies-africa/laravel\_trakker

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

techies-africa/laravel\_trakker
===============================

Official Laravel client for Trakker

v1.01(4y ago)0290PHP

Since Dec 18Pushed 4y agoCompare

[ Source](https://github.com/Techies-Africa/laravel_trakker_client)[ Packagist](https://packagist.org/packages/techies-africa/laravel_trakker)[ RSS](/packages/techies-africa-laravel-trakker/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Trakker Official Laravel Client
===============================

[](#trakker-official-laravel-client)

Trakker is a simple and easy to use website analytics service that supports server side logging. To learn more, visit [trakker.techies.africa](https://trakker.techies.africa/)

Getting Started
---------------

[](#getting-started)

First things first, create an app on [Trakker](https://trakker.techies.africa/) to obtain your APP\_KEY and APP\_SECRET.

Installation
------------

[](#installation)

```
composer require techies-africa/laravel_trakker
```

Next, add the service provider to your app/config.php file under the list of providers.

```
'providers' => [
    ...,
    App\Providers\RouteServiceProvider::class,
    TechiesAfrica\LaravelTrakker\Providers\TrakkerServiceProvider::class,
    ...
],

```

Finally, add the middleware to your app\\Http\\Kernel.php file under the $middleware array. You can add it under any array that best suites your needs.

```
protected $middleware = [
     ...,
     \Illuminate\Session\Middleware\StartSession::class,
     TechiesAfrica\LaravelTrakker\Middlewares\TrakkerMiddleware::class,
     ...
];

```

Setup complete. Now you need to add your keys to your .env file.

```

TRAKKER_BASE_URL="https://trakker.techies.africa"
TRAKKER_APP_KEY="*************"
TRAKKER_APP_SECRET="********"
TRAKKER_LOG_CHANNEL="stack"

```

If you wish to log errors in a seperate file other than the default laravel.log file, then, add this to array of channels in the app/logging.php file.

```
 'trakker' => [
     'driver' => 'single',
     'path' => storage_path('logs/trakker.log'),
     'level' => 'debug',
 ],

```

Usage
-----

[](#usage)

Once installation is complete , you should be able to see your activities on your app`s dashboard. You can customize the configurations as you see fit.

This is what the TrakkerMiddleware looks like. If you would like to implement it differently , do well to create a middleware , copy the content of the handle method and remember to register your new middleware in your Kernel file.

```
