bartoszf/simple-analytics

Laravel package for implementing simple analytics

v0.8.6 2017-11-03 12:57 UTC

This package is not auto-updated.

Last update: 2024-04-21 07:24:18 UTC


README

Laravel Source License

Laravel package for implementing simple analytics

Table of Contents

Requirements

  • This package requires PHP 5.6+
  • As for now, you need Auth facade with user.

Getting Started

  1. Require the package in your composer.json and update your dependency with composer update:
"require": {
...
"bartoszf/simple-analytics": "~0.8",
...
},
  1. Add the package to your application service providers in config/app.php.
'providers' => [

Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
Illuminate\Auth\AuthServiceProvider::class,
...
BartoszF\SimpleAnalytics\AnalyticsServiceProvider::class,

],
  1. Publish the package migrations to your application and run these with php artisan migrate.
$ php artisan vendor:publish --provider="BartoszF\SimpleAnalytics\AnalyticsServiceProvider"
  1. Add the middleware to your app/Http/Kernel.php.
protected $routeMiddleware = [

....
'analytics' => BartoszF\SimpleAnalytics\Middleware\ReportUserRouteMiddleware::class,

];
  1. Adjust view as you wish (probably extend it with your app layout)

  2. Add analytics middleware to your routes from wich you want to get details.

Contribution Guidelines

Support follows PSR-2 PHP coding standards, and semantic versioning.

Please report any issue you find in the issues page. Pull requests are welcome.