bartoszf / simple-analytics
Laravel package for implementing simple analytics
v0.8.6
2017-11-03 12:57 UTC
Requires
- php: ^5.6 || ^7.0
This package is not auto-updated.
Last update: 2024-04-21 07:24:18 UTC
README
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
- Require the package in your
composer.json
and update your dependency withcomposer update
:
"require": {
...
"bartoszf/simple-analytics": "~0.8",
...
},
- 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, ],
- Publish the package migrations to your application and run these with
php artisan migrate
.
$ php artisan vendor:publish --provider="BartoszF\SimpleAnalytics\AnalyticsServiceProvider"
- Add the middleware to your
app/Http/Kernel.php
.
protected $routeMiddleware = [ .... 'analytics' => BartoszF\SimpleAnalytics\Middleware\ReportUserRouteMiddleware::class, ];
-
Adjust view as you wish (probably extend it with your app layout)
-
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.