Laravel Stats Tracker

Overview

Laravel Stats Tracker

Latest Stable Version License Downloads

Tracker gathers a lot of information from your requests to identify and store:

  • Sessions
  • Page Views (hits on routes)
  • Users (logged users)
  • Devices (computer, smartphone, tablet...)
  • Languages (preference, language range)
  • User Devices (by, yeah, storing a cookie on each device)
  • Browsers (Chrome, Mozilla Firefox, Safari, Internet Explorer...)
  • Operating Systems (iOS, Mac OS, Linux, Windows...)
  • Geo Location Data (Latitute, Longitude, Country and City)
  • Routes and all its parameters
  • Events
  • Referers (url, medium, source, search term...)
  • Exceptions/Errors
  • Sql queries and all its bindings
  • Url queries and all its arguments
  • Database connections

Index

Why?

Storing user tracking information, on indexed and normalized database tables, wastes less disk space and ease the extract of valuable information about your application and business.

Usage

As soon as you install and enable it, Tracker will start storing all information you tell it to, then you can in your application use the Tracker Facade to access everything. Here are some of the methods and relationships available:

Current Session/Visitor

$visitor = Tracker::currentSession();

Most of those methods return an Eloquent model or collection, so you can use not only its attributes, but also relational data:

var_dump( $visitor->client_ip );

var_dump( $visitor->device->is_mobile );

var_dump( $visitor->device->platform );

var_dump( $visitor->geoIp->city );

var_dump( $visitor->language->preference );

Sessions (visits)

$sessions = Tracker::sessions(60 * 24); // get sessions (visits) from the past day
foreach ($sessions as $session)
{
    var_dump( $session->user->email );

    var_dump( $session->device->kind . ' - ' . $session->device->platform );

    var_dump( $session->agent->browser . ' - ' . $session->agent->browser_version );

    var_dump( $session->geoIp->country_name );

    foreach ($session->session->log as $log)
    {
    	var_dump( $log->path );
    }
}

Online Users

Brings all online sessions (logged and unlogged users)

$users = Tracker::onlineUsers(); // defaults to 3 minutes

Users

$users = Tracker::users(60 * 24);

User Devices

$users = Tracker::userDevices(60 * 24, $user->id);

Events

$events = Tracker::events(60 * 24);

Errors

$errors = Tracker::errors(60 * 24);

PageViews summary

$pageViews = Tracker::pageViews(60 * 24 * 30);

PageViews By Country summary

$pageViews = Tracker::pageViewsByCountry(60 * 24);

Filter range

You can send timestamp ranges to those methods using the Minutes class:

$range = new Minutes();

$range->setStart(Carbon::now()->subDays(2));

$range->setEnd(Carbon::now()->subDays(1));

Tracker::userDevices($range);

Routes By Name

Having a route of

Route::get('user/{id}', ['as' => 'user.profile', 'use' => 'UsersController@profile']);

You can use this method to select all hits on that particular route and count them using Laravel:

return Tracker::logByRouteName('user.profile')
        ->where(function($query)
        {
            $query
                ->where('parameter', 'id')
                ->where('value', 1);
        })
        ->count();

And if you need count how many unique visitors accessed that route, you can do:

return Tracker::logByRouteName('tracker.stats.log')
        ->where(function($query)
        {
            $query
                ->where('parameter', 'uuid')
                ->where('value', '8b6faf82-00f1-4db9-88ad-32e58cfb4f9d');
        })
        ->select('tracker_log.session_id')
        ->groupBy('tracker_log.session_id')
        ->distinct()
        ->count('tracker_log.session_id');

Screenshots

Visits

visits

Charts

charts

Users

users

Events

events

Errors

errors

Blade Views

The views above are available in this package, but you need to install the sb-admin panel on your public folder, please look at the instructions below.

How data is stored

All tables are prefixed by tracker_, and here's an extract of some of them, showing columns and contents:

sessions

+-----+--------------------------------------+---------+-----------+----------+-----------------+------------+-----------+----------+-------------+
| id  | uuid                                 | user_id | device_id | agent_id | client_ip       | referer_id | cookie_id | geoip_id | language_id |
+-----+--------------------------------------+---------+-----------+----------+-----------------+------------+-----------+----------+-------------+
| 1   | 09465be3-5930-4581-8711-5161f62c4373 | 1       | 1         | 1        | 186.228.127.245 | 2          | 1         | 2        | 3           |
| 2   | 07399969-0a19-47f0-862d-43b06d7cde45 |         | 2         | 2        | 66.240.192.138  |            | 2         | 2        | 2           |
+-----+--------------------------------------+---------+-----------+----------+-----------------+------------+-----------+----------+-------------+

devices

+----+----------+-------------+-------------+------------------+-----------+
| id | kind     | model       | platform    | platform_version | is_mobile |
+----+----------+-------------+-------------+------------------+-----------+
| 1  | Computer | unavailable | Windows 8   |                  |           |
| 2  | Tablet   | iPad        | iOS         | 7.1.1            | 1         |
| 3  | Computer | unavailable | Windows XP  |                  |           |
| 5  | Computer | unavailable | Other       |                  |           |
| 6  | Computer | unavailable | Windows 7   |                  |           |
| 7  | Computer | unavailable | Windows 8.1 |                  |           |
| 8  | Phone    | iPhone      | iOS         | 7.1              | 1         |
+----+----------+-------------+-------------+------------------+-----------+

agents

+----+-----------------------------------------------------------------------------------------------------------------------------------------+-------------------+-----------------+
| id | name                                                                                                                                    | browser           | browser_version |
+----+-----------------------------------------------------------------------------------------------------------------------------------------+-------------------+-----------------+
| 1  | Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36                           | Chrome            | 35.0.1916       |
| 2  | Mozilla/5.0 (iPad; CPU OS 7_1_1 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) CriOS/34.0.1847.18 Mobile/11D201 Safari/9537.53 | Chrome Mobile iOS | 34.0.1847       |
| 3  | Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)                                                                                      | IE                | 6.0             |
| 4  | Python-urllib/2.6                                                                                                                       | Other             |                 |
| 5  | Other                                                                                                                                   | Other             |                 |
| 6  | Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36                           | Chrome            | 34.0.1847       |
| 7  | Mozilla/5.0 (Windows NT 6.3; rv:28.0) Gecko/20100101 Firefox/28.0                                                                       | Firefox           | 28.0            |
| 8  | Mozilla/5.0 (iPhone; CPU iPhone OS 7_1 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D169 Safari/9537.53 | Mobile Safari     | 7.0             |
+----+-----------------------------------------------------------------------------------------------------------------------------------------+-------------------+-----------------+

languages

+----+------------+----------------+
| id | preference | language_range |
+----+------------+----------------+
| 1  | en         | ru=0.8,es=0.5  |
| 2  | es         | en=0.7,ru=0.3  |
| 3  | ru         | en=0.5,es=0.5  |
+----+------------+----------------+

domains

+----+--------------------------+
| id | name                     |
+----+--------------------------+
| 1  | antoniocarlosribeiro.com |
+----+--------------------------+

errors

+----+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id | code | message                                                                                                                                                                                                                      |
+----+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 1  | 404  |                                                                                                                                                                                                                              |
| 2  | 500  | Call to undefined method PragmaRX\Tracker\Tracker::sessionLog()                                                                                                                                                              |
| 3  | 500  | Trying to get property of non-object (View: /home/forge/stage.antoniocarlosribeiro.com/app/views/admin/tracker/log.blade.php)                                                                                                |
| 4  | 500  | syntax error, unexpected 'foreach' (T_FOREACH)                                                                                                                                                                               |
| 5  | 500  | Call to undefined method PragmaRX\Tracker\Tracker::pageViewsByCountry()                                                                                                                                                      |
| 6  | 500  | Class PragmaRX\Firewall\Vendor\Laravel\Artisan\Base contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Illuminate\Console\Command::fire)                                 |
| 7  | 405  |                                                                                                                                                                                                                              |
| 8  | 500  | Trying to get property of non-object                                                                                                                                                                                         |
| 9  | 500  | Missing argument 2 for Illuminate\Database\Eloquent\Model::setAttribute(), called in /home/forge/stage.antoniocarlosribeiro.com/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php on line 2444 and defined |
+----+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

events

+----+------------------------------------------------+
| id | name                                           |
+----+------------------------------------------------+
| 1  | illuminate.log                                 |
| 2  | router.before                                  |
| 3  | router.matched                                 |
| 4  | auth.attempt                                   |
| 5  | auth.login                                     |
| 6  | composing: admin.tracker.index                 |
| 7  | creating: admin.tracker._partials.menu         |
| 8  | composing: admin.tracker._partials.menu        |
| 9  | creating: admin.layout                         |
| 10 | composing: admin.layout                        |
| 11 | creating: admin._partials.mainMenu             |
| 12 | composing: admin._partials.mainMenu            |
| 13 | creating: admin._partials.messages             |
| 14 | composing: admin._partials.messages            |
| 15 | creating: global._partials.google-analytics    |
| 16 | composing: global._partials.google-analytics   |
+----+------------------------------------------------+

geoip

+----+----------+-----------+--------------+---------------+---------------------------+--------+----------------+-------------+-----------+----------+------------+----------------+
| id | latitude | longitude | country_code | country_code3 | country_name              | region | city           | postal_code | area_code | dma_code | metro_code | continent_code |
+----+----------+-----------+--------------+---------------+---------------------------+--------+----------------+-------------+-----------+----------+------------+----------------+
| 1  | 37.4192  | -122.057  | US           | USA           | United States             | CA     | Mountain View  | 94043       | 650       | 807      | 807        | NA             |
| 2  | -10      | -55       | BR           | BRA           | Brazil                    |        |                |             |           |          |            | SA             |
| 3  | 30.3909  | -86.3161  | US           | USA           | United States             | FL     | Miramar Beach  | 32550       | 850       | 686      | 686        | NA             |
| 4  | 38.65    | -90.5334  | US           | USA           | United States             | MO     | Chesterfield   | 63017       | 314       | 609      | 609        | NA             |
| 5  | 42.7257  | -84.636   | US           | USA           | United States             | MI     | Lansing        | 48917       | 517       | 551      | 551        | NA             |
| 6  | 42.8884  | -78.8761  | US           | USA           | United States             | NY     | Buffalo        | 14202       | 716       | 514      | 514        | NA             |
| 7  | 40.1545  | -75.3809  | US           | USA           | United States             | PA     | Norristown     | 19403       | 610       | 504      | 504        | NA             |
| 8  | 47.4891  | -122.291  | US           | USA           | United States             | WA     | Seattle        | 98168       | 206       | 819      | 819        | NA             |
| 9  | 33.7516  | -84.3915  | US           | USA           | United States             | GA     | Atlanta        | 30303       | 404       | 524      | 524        | NA             |
| 10 | 33.7633  | -117.794  | US           | USA           | United States             | CA     | Santa Ana      | 92705       | 714       | 803      | 803        | NA             |
| 11 | 33.4357  | -111.917  | US           | USA           | United States             | AZ     | Tempe          | 85281       | 480       | 753      | 753        | NA             |
| 12 | 40.7421  | -74.0018  | US           | USA           | United States             | NY     | New York       | 10011       | 212       | 501      | 501        | NA             |
| 13 | 28.6185  | -81.4336  | US           | USA           | United States             | FL     | Orlando        | 32810       | 407       | 534      | 534        | NA             |
| 14 | 38.6312  | -90.1922  | US           | USA           | United States             | MO     | Saint Louis    | 63101       | 314       | 609      | 609        | NA             |
| 15 | 51       | 9         | DE           | DEU           | Germany                   |        |                |             |           |          |            | EU             |
| 16 | 52.5     | 5.75      | NL           | NLD           | Netherlands               |        |                |             |           |          |            | EU             |
| 17 | 48.86    | 2.35      | FR           | FRA           | France                    |        |                |             |           |          |            | EU             |
| 18 | 60       | 100       | RU           | RUS           | Russian Federation        |        |                |             |           |          |            | EU             |
| 19 | 51.5     | -0.13     | GB           | GBR           | United Kingdom            |        |                |             |           |          |            | EU             |
| 20 | 42.8333  | 12.8333   | IT           | ITA           | Italy                     |        |                |             |           |          |            | EU             |
| 21 | 59.3333  | 18.05     | SE           | SWE           | Sweden                    | 26     | Stockholm      |             |           |          |            | EU             |
| 22 | -41      | 174       | NZ           | NZL           | New Zealand               |        |                |             |           |          |            | OC             |
| 23 | 37.57    | 126.98    | KR           | KOR           | Korea, Republic of        |        |                |             |           |          |            | AS             |
| 24 | 1.3667   | 103.8     | SG           | SGP           | Singapore                 |        |                |             |           |          |            | AS             |
| 25 | -43.5333 | 172.633   | NZ           | NZL           | New Zealand               | E9     | Christchurch   | 8023        |           |          |            | OC             |
| 26 | -27.471  | 153.024   | AU           | AUS           | Australia                 | 04     | Brisbane       |             |           |          |            | OC             |
| 27 | 26.9167  | 75.8167   | IN           | IND           | India                     | 24     | Jaipur         |             |           |          |            | AS             |
| 28 | 32       | 53        | IR           | IRN           | Iran, Islamic Republic of |        |                |             |           |          |            | AS             |
| 29 | 32.0617  | 118.778   | CN           | CHN           | China                     | 04     | Nanjing        |             |           |          |            | AS             |
| 30 | -22.9    | -47.0833  | BR           | BRA           | Brazil                    | 27     | Campinas       |             |           |          |            | SA             |
| 31 | 32.8073  | -117.132  | US           | USA           | United States             | CA     | San Diego      | 92123       | 858       | 825      | 825        | NA             |
| 32 | -22.9    | -43.2333  | BR           | BRA           | Brazil                    | 21     | Rio De Janeiro |             |           |          |            | SA             |
+----+----------+-----------+--------------+---------------+---------------------------+--------+----------------+-------------+-----------+----------+------------+----------------+

log

+-----+------------+---------+----------+--------+---------------+---------+-----------+---------+------------+----------+
| id  | session_id | path_id | query_id | method | route_path_id | is_ajax | is_secure | is_json | wants_json | error_id |
+-----+------------+---------+----------+--------+---------------+---------+-----------+---------+------------+----------+
| 1   | 1          | 1       |          | GET    | 1             |         | 1         |         |            |          |
| 2   | 1          | 2       |          | GET    | 2             |         | 1         |         |            |          |
| 3   | 1          | 3       |          | GET    | 3             |         | 1         |         |            |          |
| 4   | 1          | 3       |          | POST   | 4             |         | 1         |         |            |          |
+-----+------------+---------+----------+--------+---------------+---------+-----------+---------+------------+----------+

paths

+----+--------------------------------------------------------+
| id | path                                                   |
+----+--------------------------------------------------------+
| 1  | /                                                      |
| 2  | admin                                                  |
| 3  | login                                                  |
| 4  | admin/languages                                        |
| 5  | admin/tracker                                          |
| 6  | admin/pages                                            |
| 7  | jmx-console                                            |
| 8  | manager/html                                           |
| 9  | administrator                                          |
| 10 | joomla/administrator                                   |
| 11 | cms/administrator                                      |
| 12 | Joomla/administrator                                   |
| 13 | phpmyadmin                                             |
| 14 | phpMyAdmin                                             |
| 15 | mysql                                                  |
| 16 | sql                                                    |
| 17 | myadmin                                                |
| 18 | webdav                                                 |
+----+--------------------------------------------------------+

route_paths

+----+----------+--------------------------------------------------------+
| id | route_id | path                                                   |
+----+----------+--------------------------------------------------------+
| 1  | 1        | /                                                      |
| 2  | 2        | admin                                                  |
| 3  | 3        | login                                                  |
| 4  | 4        | login                                                  |
| 5  | 5        | admin/languages                                        |
| 6  | 6        | admin/tracker                                          |
| 7  | 7        | admin/pages                                            |
+----+----------+--------------------------------------------------------+

routes

+----+--------------------------------------+----------------------------------------------------------+
| id | name                                 | action                                                   |
+----+--------------------------------------+----------------------------------------------------------+
| 1  | home                                 | ACR\Controllers\Home@index                               |
| 2  | admin                                | ACR\Controllers\Admin\Admin@index                        |
| 3  | login.form                           | ACR\Controllers\Logon@form                               |
| 4  | login.do                             | ACR\Controllers\Logon@login                              |
| 5  | admin.languages.index                | ACR\Controllers\Admin\Languages@index                    |
| 6  | admin.tracker.index                  | ACR\Controllers\Admin\Tracker@index                      |
| 7  | admin.pages.index                    | ACR\Controllers\Admin\Pages@index                        |
| 8  | admin.tracker.log                    | ACR\Controllers\Admin\Tracker@log                        |
| 9  | technology                           | ACR\Controllers\Technology@index                         |
| 10 | technology.articles.show             | ACR\Controllers\Technology@show                          |
| 11 | language.select                      | ACR\Controllers\Language@select                          |
| 12 | admin.tracker.summary                | ACR\Controllers\Admin\Tracker@summary                    |
| 13 | admin.tracker.api.pageviews          | ACR\Controllers\Admin\Tracker@apiPageviews               |
| 14 | admin.tracker.api.pageviewsbycountry | ACR\Controllers\Admin\Tracker@apiPageviewsByCountry      |
| 15 | admin.pages.create                   | ACR\Controllers\Admin\Pages@create                       |
| 16 | api.markdown                         | ACR\Controllers\Api@markdown                             |
| 17 | admin.pages.store                    | ACR\Controllers\Admin\Pages@store                        |
| 18 | bio                                  | ACR\Controllers\StaticPages@show                         |
| 19 | logout.do                            | ACR\Controllers\Logon@logout                             |
| 20 | admin.tracker.index                  | ACR\Controllers\Admin\UsageTracker@index                 |
| 21 | admin.tracker.api.pageviewsbycountry | ACR\Controllers\Admin\UsageTracker@apiPageviewsByCountry |
| 22 | admin.tracker.api.pageviews          | ACR\Controllers\Admin\UsageTracker@apiPageviews          |
+----+--------------------------------------+----------------------------------------------------------+

sql_queries ;

+----+------------------------------------------+-------------------------------------------------------------------------------------------------+-------+---------------+
| id | sha1                                     | statement                                                                                       | time  | connection_id |
+----+------------------------------------------+-------------------------------------------------------------------------------------------------+-------+---------------+
| 1  | 5aee121018ac16dbf26dbbe0cf35fd44a29a5d7e | select * from "users" where "id" = ? limit 1                                                    | 3.13  | 1             |
| 2  | 0fc3f3a722b0f9ef38e6bee44fc3fde9fb1fd1d9 | select "created_at" from "articles" where "published_at" is not null order by "created_at" desc | 1.99  | 1             |
+----+------------------------------------------+-------------------------------------------------------------------------------------------------+-------+---------------+

Manually log things

If your application has special needs, you can manually log things like:

Events

Tracker::trackEvent(['event' => 'cart.add']);
Tracker::trackEvent(['event' => 'cart.add', 'object' => 'App\Cart\Events\Add']);

Routes

Tracker::trackVisit(
    [
        'name' => 'my.dynamic.route.name',
        'action' => 'MyDynamic@url'
    ],
    ['path' => 'my/dynamic/url']
);

Requirements

  • Laravel 5+
  • PHP 5.3.7+
  • Package "geoip/geoip":"~1.14" or "geoip2/geoip2":"~2.0" (If you are planning to store Geo IP information)

For Laravel 4+ please use version 2.0.10.

Installing

Require the tracker package by executing the following command in your command line:

composer require pragmarx/tracker

Add the service provider to your app/config/app.php:

 PragmaRX\Tracker\Vendor\Laravel\ServiceProvider::class,

Add the alias to the facade on your app/config/app.php:

'Tracker' => 'PragmaRX\Tracker\Vendor\Laravel\Facade',

Publish tracker configuration:

Laravel 4

php artisan config:publish pragmarx/tracker

Laravel 5

php artisan vendor:publish --provider="PragmaRX\Tracker\Vendor\Laravel\ServiceProvider"

Enable the Middleware (Laravel 5)

Open the newly published config file found at app/config/tracker.php and enable use_middleware:

'use_middleware' => true,

Add the Middleware to Laravel Kernel (Laravel 5)

Open the file app/Http/Kernel.php and add the following to your web middlewares:

\PragmaRX\Tracker\Vendor\Laravel\Middlewares\Tracker::class,

Enable Tracker in your config.php (Laravel 4) or tracker.php (Laravel 5)

'enabled' => true,

Publish the migration

php artisan tracker:tables

This is only needed if you are on Laravel 4, because vendor:publish does it for you in Laravel 5.

Create a database connection for it on your config/database.php

'connections' => [
    'mysql' => [
        ...
    ],
    
    'tracker' => [
    	'driver'   => '...',
    	'host'     => '...',
    	'database' => ...,
        'strict' => false,    // to avoid problems on some MySQL installs
    	...
    ],
],

Migrate it

If you have set the default connection to tracker, you can

php artisan migrate

Otherwise you'll have to

php artisan migrate --database=tracker

If you are planning to store Geo IP information, also install the geoip package:

composer require "geoip/geoip":"~1.14"

or

composer require "geoip2/geoip2":"~2.0"

And make sure you don't have the PHP module installed. This is a Debian/Ubuntu example:

sudo apt-get purge php5-geoip

Everything Is Disabled By Default

Tracker has a lot of logging options, but you need to decide what you want to log. Starting by enabling this one:

'log_enabled' => true,

It is responsible for logging page hits and sessions, basically the client IP address.

Multiple authentication drivers

You just have to all your auth IOC bidings to the array:

'authentication_ioc_binding' => ['auth', 'admin'],

Stats Panel

To use the stats panel on your website you'll need to download the sb-admin 2 sources to your public folder:

git clone https://github.com/BlackrockDigital/startbootstrap-sb-admin-2.git public/templates/sb-admin-2
cd public/templates/sb-admin-2
git checkout tags/v3.3.7+1
git checkout -b v3.3.7+1

And enabled in your config file:

'stats_panel_enabled' => true,

Set the web middleware for stats routes (Laravel 5)

'stats_routes_middleware' => 'web',

Only admins can view the stats, so if you don't have an is_admin attribute on your user model, you'll have to add one:

public function getIsAdminAttribute()
{
    return true;
}

It can be 'admin', 'is_admin', 'root' or 'is_root'.

Troubleshooting

Is everything enabled?

Make sure Tracker is enabled in the config file. Usually this is the source of most problems.

Tail your laravel.log file

tail -f storage/logs/laravel.log

Usually non-trackable IP addresses and other messages will appear in the log:

[2018-03-19 21:28:08] local.WARNING: TRACKER (unable to track item): 127.0.0.1 is not trackable.

SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'field name'

This is probably related to SQL modes on MySQL, specifically with NO_ZERO_IN_DATE and NO_ZERO_DATE modes:

https://stackoverflow.com/questions/36882149/error-1067-42000-invalid-default-value-for-created-at

Because Laravel's defaults to

set session sql_mode='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'

You may need to change your Tracker database connection configuration to

'connections' => [
    ...

    'tracker' => [
        ...

        'strict'    => false,
    ],
],

Not able to track users?

If you get an error like:

Base table or view not found: 1146 Table 'tracker.users' doesn't exist

You probably need to change:

'user_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\User',

To create (or use a current) a User model:

'user_model' => 'App\TrackerUser',

And configure the Connection related to your users table:

protected $connection = 'mysql';

Not able to track API's?

In your kernel

protected $middlewareGroups = [
    'web' => [
        .......
        \PragmaRX\Tracker\Vendor\Laravel\Middlewares\Tracker::class,
    ],

    'api' => [
       .......
        \PragmaRX\Tracker\Vendor\Laravel\Middlewares\Tracker::class,
    ],
];

Author

Antonio Carlos Ribeiro All Contributors

License

Tracker is licensed under the BSD 3-Clause License - see the LICENSE file for details

Contributing

Pull requests and issues are more than welcome.

Comments
  • Undefined index: PragmaRX\Tracker\Vendor\Laravel\Models\Session

    Undefined index: PragmaRX\Tracker\Vendor\Laravel\Models\Session

    after upgrade to laravel 5.7 I received this error

    Undefined index: PragmaRX\Tracker\Vendor\Laravel\Models\Session

    Undefined index: PragmaRX\Tracker\Vendor\Laravel\Models\Session {"exception":"[object] (ErrorException(code: 0): Undefined index: PragmaRX\\Tracker\\Vendor\\Laravel\\Models\\Session at C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Eloquent\\Model.php:241) [stacktrace]#0 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Eloquent\\Model.php(241): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(8, 'Undefined index...', 'C:\\\\wamp\\\\www\\\\SPF...', 241, Array)#1 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Eloquent\\Model.php(167): Illuminate\\Database\\Eloquent\\Model->initializeTraits()#2 C:\\wamp\\www\\SPF\\vendor\\pragmarx\\tracker\\src\\Vendor\\Laravel\\Models\\Base.php(16): Illuminate\\Database\\Eloquent\\Model->__construct(Array)#3 C:\\wamp\\www\\SPF\\vendor\\pragmarx\\tracker\\src\\Vendor\\Laravel\\Models\\Session.php(24): PragmaRX\\Tracker\\Vendor\\Laravel\\Models\\Base->__construct(Array)#4 C:\\wamp\\www\\SPF\\vendor\\pragmarx\\tracker\\src\\Vendor\\Laravel\\ServiceProvider.php(417): PragmaRX\\Tracker\\Vendor\\Laravel\\Models\\Session->__construct()#5 C:\\wamp\\www\\SPF\\vendor\\pragmarx\\tracker\\src\\Vendor\\Laravel\\ServiceProvider.php(169): PragmaRX\\Tracker\\Vendor\\Laravel\\ServiceProvider->instantiateModel('session_model')#6 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(764): PragmaRX\\Tracker\\Vendor\\Laravel\\ServiceProvider->PragmaRX\\Tracker\\Vendor\\Laravel\\{closure}(Object(Illuminate\\Foundation\\Application), Array)#7 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(646): Illuminate\\Container\\Container->build(Object(Closure))#8 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(601): Illuminate\\Container\\Container->resolve('tracker.reposit...', Array)#9 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Application.php(733): Illuminate\\Container\\Container->make('tracker.reposit...', Array)#10 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(1210): Illuminate\\Foundation\\Application->make('tracker.reposit...')#11 C:\\wamp\\www\\SPF\\vendor\\pragmarx\\tracker\\src\\Vendor\\Laravel\\ServiceProvider.php(150): Illuminate\\Container\\Container->offsetGet('tracker.reposit...')#12 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(764): PragmaRX\\Tracker\\Vendor\\Laravel\\ServiceProvider->PragmaRX\\Tracker\\Vendor\\Laravel\\{closure}(Object(Illuminate\\Foundation\\Application), Array)#13 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(646): Illuminate\\Container\\Container->build(Object(Closure))#14 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(601): Illuminate\\Container\\Container->resolve('tracker', Array)#15 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Application.php(733): Illuminate\\Container\\Container->make('tracker', Array)#16 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(1210): Illuminate\\Foundation\\Application->make('tracker')#17 C:\\wamp\\www\\SPF\\vendor\\pragmarx\\tracker\\src\\Vendor\\Laravel\\ServiceProvider.php(635): Illuminate\\Container\\Container->offsetGet('tracker')#18 C:\\wamp\\www\\SPF\\vendor\\pragmarx\\tracker\\src\\Vendor\\Laravel\\ServiceProvider.php(493): PragmaRX\\Tracker\\Vendor\\Laravel\\ServiceProvider->getTracker()#19 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Events\\Dispatcher.php(357): PragmaRX\\Tracker\\Vendor\\Laravel\\ServiceProvider->PragmaRX\\Tracker\\Vendor\\Laravel\\{closure}('eloquent.bootin...', Array)#20 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Events\\Dispatcher.php(209): Illuminate\\Events\\Dispatcher->Illuminate\\Events\\{closure}('eloquent.bootin...', Array)#21 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Eloquent\\Concerns\\HasEvents.php(162): Illuminate\\Events\\Dispatcher->dispatch('eloquent.bootin...', Array)#22 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Eloquent\\Model.php(184): Illuminate\\Database\\Eloquent\\Model->fireModelEvent('booting', false)#23 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Eloquent\\Model.php(165): Illuminate\\Database\\Eloquent\\Model->bootIfNotBooted()#24 C:\\wamp\\www\\SPF\\vendor\\pragmarx\\tracker\\src\\Vendor\\Laravel\\Models\\Base.php(16): Illuminate\\Database\\Eloquent\\Model->__construct(Array)#25 C:\\wamp\\www\\SPF\\vendor\\pragmarx\\tracker\\src\\Vendor\\Laravel\\Models\\Session.php(24): PragmaRX\\Tracker\\Vendor\\Laravel\\Models\\Base->__construct(Array)#26 C:\\wamp\\www\\SPF\\vendor\\pragmarx\\tracker\\src\\Vendor\\Laravel\\ServiceProvider.php(417): PragmaRX\\Tracker\\Vendor\\Laravel\\Models\\Session->__construct()#27 C:\\wamp\\www\\SPF\\vendor\\pragmarx\\tracker\\src\\Vendor\\Laravel\\ServiceProvider.php(169): PragmaRX\\Tracker\\Vendor\\Laravel\\ServiceProvider->instantiateModel('session_model')#28 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(764): PragmaRX\\Tracker\\Vendor\\Laravel\\ServiceProvider->PragmaRX\\Tracker\\Vendor\\Laravel\\{closure}(Object(Illuminate\\Foundation\\Application), Array)#29 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(646): Illuminate\\Container\\Container->build(Object(Closure))#30 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(601): Illuminate\\Container\\Container->resolve('tracker.reposit...', Array)#31 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Application.php(733): Illuminate\\Container\\Container->make('tracker.reposit...', Array)#32 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(1210): Illuminate\\Foundation\\Application->make('tracker.reposit...')#33 C:\\wamp\\www\\SPF\\vendor\\pragmarx\\tracker\\src\\Vendor\\Laravel\\ServiceProvider.php(150): Illuminate\\Container\\Container->offsetGet('tracker.reposit...')#34 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(764): PragmaRX\\Tracker\\Vendor\\Laravel\\ServiceProvider->PragmaRX\\Tracker\\Vendor\\Laravel\\{closure}(Object(Illuminate\\Foundation\\Application), Array)#35 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(646): Illuminate\\Container\\Container->build(Object(Closure))#36 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(601): Illuminate\\Container\\Container->resolve('tracker', Array)#37 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Application.php(733): Illuminate\\Container\\Container->make('tracker', Array)#38 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(1210): Illuminate\\Foundation\\Application->make('tracker')#39 C:\\wamp\\www\\SPF\\vendor\\pragmarx\\tracker\\src\\Vendor\\Laravel\\ServiceProvider.php(635): Illuminate\\Container\\Container->offsetGet('tracker')#40 C:\\wamp\\www\\SPF\\vendor\\pragmarx\\tracker\\src\\Vendor\\Laravel\\ServiceProvider.php(373): PragmaRX\\Tracker\\Vendor\\Laravel\\ServiceProvider->getTracker()#41 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Events\\Dispatcher.php(360): PragmaRX\\Tracker\\Vendor\\Laravel\\ServiceProvider->PragmaRX\\Tracker\\Vendor\\Laravel\\{closure}(Object(Illuminate\\Routing\\Events\\RouteMatched))#42 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Events\\Dispatcher.php(209): Illuminate\\Events\\Dispatcher->Illuminate\\Events\\{closure}('Illuminate\\\\Rout...', Array)#43 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(653): Illuminate\\Events\\Dispatcher->dispatch('Illuminate\\\\Rout...')#44 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(622): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))#45 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(611): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))#46 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php(176): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))#47 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php(30): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))#48 C:\\wamp\\www\\SPF\\vendor\enatomarinho\\laravel-page-speed\\src\\Middleware\\PageSpeed.php(27): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))#49 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(151): RenatoMarinho\\LaravelPageSpeed\\Middleware\\PageSpeed->handle(Object(Illuminate\\Http\\Request), Object(Closure))#50 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))#51 C:\\wamp\\www\\SPF\\vendor\enatomarinho\\laravel-page-speed\\src\\Middleware\\PageSpeed.php(27): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))#52 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(151): RenatoMarinho\\LaravelPageSpeed\\Middleware\\PageSpeed->handle(Object(Illuminate\\Http\\Request), Object(Closure))#53 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))#54 C:\\wamp\\www\\SPF\\vendor\enatomarinho\\laravel-page-speed\\src\\Middleware\\PageSpeed.php(27): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))#55 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(151): RenatoMarinho\\LaravelPageSpeed\\Middleware\\PageSpeed->handle(Object(Illuminate\\Http\\Request), Object(Closure))#56 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))#57 C:\\wamp\\www\\SPF\\vendor\enatomarinho\\laravel-page-speed\\src\\Middleware\\PageSpeed.php(27): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))#58 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(151): RenatoMarinho\\LaravelPageSpeed\\Middleware\\PageSpeed->handle(Object(Illuminate\\Http\\Request), Object(Closure))#59 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))#60 C:\\wamp\\www\\SPF\\vendor\enatomarinho\\laravel-page-speed\\src\\Middleware\\PageSpeed.php(27): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))#61 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(151): RenatoMarinho\\LaravelPageSpeed\\Middleware\\PageSpeed->handle(Object(Illuminate\\Http\\Request), Object(Closure))#62 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))#63 C:\\wamp\\www\\SPF\\vendor\enatomarinho\\laravel-page-speed\\src\\Middleware\\PageSpeed.php(27): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))#64 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(151): RenatoMarinho\\LaravelPageSpeed\\Middleware\\PageSpeed->handle(Object(Illuminate\\Http\\Request), Object(Closure))#65 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))#66 C:\\wamp\\www\\SPF\\vendor\enatomarinho\\laravel-page-speed\\src\\Middleware\\PageSpeed.php(27): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))#67 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(151): RenatoMarinho\\LaravelPageSpeed\\Middleware\\PageSpeed->handle(Object(Illuminate\\Http\\Request), Object(Closure))#68 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))#69 C:\\wamp\\www\\SPF\\vendor\\fideloper\\proxy\\src\\TrustProxies.php(57): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))#70 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(151): Fideloper\\Proxy\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))#71 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))#72 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php(31): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))#73 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(151): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))#74 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))#75 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php(31): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))#76 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(151): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))#77 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))#78 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize.php(27): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))#79 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(151): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))#80 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))#81 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode.php(62): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))#82 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(151): Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode->handle(Object(Illuminate\\Http\\Request), Object(Closure))#83 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))#84 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(104): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))#85 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php(151): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))#86 C:\\wamp\\www\\SPF\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php(116): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))#87 C:\\wamp\\www\\SPF\\public\\index.php(55): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))#88 {main}"}

    bug Fixed 
    opened by tornadofay 16
  • Setup issue - Base table or view not found: 1146 Table 'tracker.users' doesn't exist

    Setup issue - Base table or view not found: 1146 Table 'tracker.users' doesn't exist

    Hi,

    Thanks a lot for offering this package. no doubt it has excellent functionalities.

    I am bit struggling with the configuration at the moment and would be grateful if you could help me through;

    My installation is Laravel 5.4. I have two mysql dbs , default mysql db is flowdb and tracker for Laravel Tracker. "tracker" db is only used for the said package. I am using Cartalyst/Sentinel for authentication which has tables in "mysql" db.

    when i migrate i get this list of exceptions; (although i am able to migrate tables)

    W:\xampp\htdocs\flow>php artisan migrate --database=tracker Migration table created successfully. Illuminate\Database\QueryException {#844 #sql: "alter tabletracker_agentsadd uniquetracker_agents_name_unique(name)" #bindings: [] #message: "SQLSTATE[42000]: Syntax error or access violation: 1170 BLOB/TEXT column 'name' used in key specification without a key length (SQL: alter tabletracker_agentsadd uniquetracker_agents_name_unique(name))" #code: "42000" #file: "W:\xampp\htdocs\flow\vendor\laravel\framework\src\Illuminate\Database\Connection.php" #line: 647

    and it goes on.

    I narrowed it down to the the migration 2017_01_31_311101_fix_agent_name. which has this code; `class FixAgentName extends Migration { /** * Table related to this migration. * * @var string */ private $table = 'tracker_agents';

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function migrateUp()
    {
        try {
            $this->builder->table(
                $this->table,
                function ($table) {
                    $table->dropUnique('tracker_agents_name_unique');
                }
            );
    
            $this->builder->table(
                $this->table,
                function ($table) {
                    $table->mediumText('name')->unique()->change();
                }
            );
        } catch (\Exception $e) {
            dd($e);
        }
    }
    
    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function migrateDown()
    {
        try {
            $this->builder->table(
                $this->table,
                function ($table) {
                    $table->string('name', 255)->change();
                    $table->unique('name');
                }
            );
        } catch (\Exception $e) {
        }
    }
    

    } `

    This is my settings for "tracker";

    `

    return [

    /*
     * Enable it?
     */
    'enabled' => true,
    
    /*
     * Enable cache?
     */
    'cache_enabled' => true,
    
    /*
     * Deffer booting for middleware use
     */
    'use_middleware' => true,
    
    /*
     * Robots should be tracked?
     */
    'do_not_track_robots' => false,
    
    /*
     * Which environments are not trackable?
     */
    'do_not_track_environments' => [
        // defaults to none
    ],
    
    /*
     * Which routes names are not trackable?
     */
    'do_not_track_routes' => [
        'tracker.stats.*',
    ],
    
    /*
     * The Do Not Track Ips is used to disable Tracker for some IP addresses:
     *
     *     '127.0.0.1', '192.168.1.1'
     *
     * You can set ranges of IPs
     *     '192.168.0.1-192.168.0.100'
     *
     * And use net masks
     *     '10.0.0.0/32'
     *     '172.17.0.0/255.255.0.0'
     */
    'do_not_track_ips' => [
        '127.0.0.0/24', /// range 127.0.0.1 - 127.0.0.255
    ],
    
    /*
     * Log every single access?
     *
     * The log table can become huge if your site is popular, but...
     *
     * Log table is also responsible for storing information on:
     *
     *    - Routes and controller actions accessed
     *    - HTTP method used (GET, POST...)
     *    - Error log
     *    - URL queries (including values)
     */
    'log_enabled' => true,
    
    /*
     * Log SQL queries?
     *
     * Log must be enabled for this option to work.
     */
    'log_sql_queries' => false,
    
    /*
     * If you prefer to store Tracker data on a different database or connection,
     * you can set it here.
     *
     * To avoid SQL queries log recursion, create a different connection for Tracker,
     * point it to the same database (or not) and forbid logging of this connection in
     * do_not_log_sql_queries_connections.
     */
    'connection' => 'tracker',
    
    /*
     * Forbid logging of SQL queries for some connections.
     *
     * To avoid recursion, you better ignore Tracker connection here.
     *
     * Please create a separate database connection for Tracker. It can hit
     * the same database of your application, but the connection itself
     * has to have a different name, so the package can ignore its own queries
     * and avoid recursion.
     *
     */
    'do_not_log_sql_queries_connections' => [
        'tracker',
    ],
    
    /*
     * Also log SQL query bindings?
     *
     * Log must be enabled for this option to work.
     */
    'log_sql_queries_bindings' => false,
    
    /*
     * Log events?
     */
    'log_events' => false,
    
    /*
     * Which events do you want to log exactly?
     */
    'log_only_events' => [
        // defaults to logging all events
    ],
    
    /*
     * What are the names of the id columns on your system?
     *
     * 'id' is the most common, but if you have one or more different,
     * please add them here in your preference order.
     */
    'id_columns_names' => [
        'id',
    ],
    /*
     * Do not log events for the following patterns.
     * Strings accepts wildcards:
     *
     *    eloquent.*
     *
     */
    'do_not_log_events' => [
        'illuminate.log',
        'eloquent.*',
        'router.*',
        'composing: *',
        'creating: *',
    ],
    
    /*
     * Do you wish to log Geo IP data?
     *
     * You will need to install the geoip package
     *
     *     composer require "geoip/geoip":"~1.14"
     *
     * And remove the PHP module
     *
     *     sudo apt-get purge php5-geoip
     *
     */
    'log_geoip' => false,
    
    /*
     * Do you wish to log the user agent?
     */
    'log_user_agents' => false,
    
    /*
     * Do you wish to log your users?
     */
    'log_users' => false,
    
    /*
     * Do you wish to log devices?
     */
    'log_devices' => false,
    
    /*
     * Do you wish to log languages?
     */
    'log_languages' => false,
    
    /*
     * Do you wish to log HTTP referers?
     */
    'log_referers' => false,
    
    /*
     * Do you wish to log url paths?
     */
    'log_paths' => false,
    
    /*
     * Do you wish to log url queries and query arguments?
     */
    'log_queries' => false,
    
    /*
     * Do you wish to log routes and route parameters?
     */
    'log_routes' => false,
    
    /*
     * Log errors and exceptions?
     */
    'log_exceptions' => false,
    
    /*
     * A cookie may be created on your visitor device, so you can have information
     * on everything made using that device on your site.	 *
     */
    'store_cookie_tracker' => false,
    
    /*
     * If you are storing cookies, you better change it to a name you of your own.
     */
    'tracker_cookie_name' => 'please_change_this_cookie_name',
    
    /*
     * Internal tracker session name.
     */
    'tracker_session_name' => 'tracker_session',
    
    /*
     * ** IMPORTANT **
     *   Change the user model to your own.
     */
    'user_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\User',
    
    /*
     * You can use your own model for every single table Tracker has.
     */
    
    'session_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Session',
    
    'log_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Log',
    
    'path_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Path',
    
    'query_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Query',
    
    'query_argument_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\QueryArgument',
    
    'agent_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Agent',
    
    'device_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Device',
    
    'cookie_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Cookie',
    
    'domain_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Domain',
    
    'referer_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Referer',
    
    'referer_search_term_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\RefererSearchTerm',
    
    'route_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Route',
    
    'route_path_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\RoutePath',
    
    'route_path_parameter_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\RoutePathParameter',
    
    'error_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Error',
    
    'geoip_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\GeoIp',
    
    'sql_query_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\SqlQuery',
    
    'sql_query_binding_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\SqlQueryBinding',
    
    'sql_query_binding_parameter_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\SqlQueryBindingParameter',
    
    'sql_query_log_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\SqlQueryLog',
    
    'connection_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Connection',
    
    'event_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Event',
    
    'event_log_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\EventLog',
    
    'system_class_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\SystemClass',
    
    'language_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Language',
    
    /*
     * Laravel internal variables on user authentication and login.
     */
    'authentication_ioc_binding' => ['auth'], // defaults to 'auth' in Illuminate\Support\Facades\Auth
    
    'authenticated_check_method' => 'check', // to Auth::check()
    
    'authenticated_user_method' => 'user', // to Auth::user()
    
    'authenticated_user_id_column' => 'id', // to Auth::user()->id
    
    'authenticated_user_username_column' => 'email', // to Auth::user()->email
    
    /*
     * Enable the Stats Panel?
     */
    'stats_panel_enabled' => false,
    
    /*
     * Stats Panel routes before filter
     *
     */
    'stats_routes_before_filter' => '',
    
    /*
     * Stats Panel routes after filter
     *
     */
    'stats_routes_after_filter' => '',
    
    /*
     * Stats Panel routes middleware
     *
     */
    'stats_routes_middleware' => 'web',
    
    /*
     * Stats Panel template path
     */
    'stats_template_path' => '/templates/sb-admin-2',
    
    /*
     * Stats Panel base uri.
     *
     * If your site url is http://wwww.mysite.com, then your stats page will be:
     *
     *    http://wwww.mysite.com/stats
     *
     */
    'stats_base_uri' => 'stats',
    
    /*
     * Stats Panel layout view
     */
    'stats_layout' => 'pragmarx/tracker::layout',
    
    /*
     * Stats Panel controllers namespace
     */
    'stats_controllers_namespace' => 'PragmaRX\Tracker\Vendor\Laravel\Controllers',
    

    ]; `

    I get this error when i try to access a view which has a list of Sentinel users from my flowdb (default);

    QueryException in Connection.php line 647: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'tracker.users' doesn't exist (SQL: select * fromuserswhereusers.idin (0)) in Connection.php line 647 at Connection->runQueryCallback('select * fromuserswhereusers.idin (?)', array(0), object(Closure)) in Connection.php line 607 at Connection->run('select * fromuserswhereusers.idin (?)', array(0), object(Closure)) in Connection.php line 326 at Connection->select('select * fromuserswhereusers.idin (?)', array(0), true) in Builder.php line 1718 at Builder->runSelect() in Builder.php line 1703 at Builder->get(array('*')) in Builder.php line 493 at Builder->getModels(array('*')) in Builder.php line 477 at Builder->get() at call_user_func_array(array(object(Builder), 'get'), array()) in Relation.php line 340 at Relation->__call('get', array()) in Relation.php line @140

    opened by aamirchaudhary 14
  • Route model binding and `tracker_route_path_parameters`

    Route model binding and `tracker_route_path_parameters`

    It looks like Tracker stored the entire JSON version of the model in the tracker_route_path_paramters' value column instead of the ID when using route model binding.

    I haven't quite looked at the code yet so not sure if it's easy to fix.

    opened by tomvo 14
  • Don't get it working on Laravel 4.2

    Don't get it working on Laravel 4.2

    I installed the Package on my Laravel 4.2 System, but as soon as I enable it "'enabled' => true," I get the following error: "Call to a member function connection() on a non-object".

    Can't really find the cause and a solution to get it working.

    Would be cool if you could help me out there.

    opened by kremsy 12
  • Error: vendor/pragmarx/datatables/src/Bllim/Datatables/views

    Error: vendor/pragmarx/datatables/src/Bllim/Datatables/views" directory does not exist

    Describe the bug A clear and concise description of what the bug is.

    To Reproduce Steps to reproduce the behavior: Run command: php artisan view:cache

    Expected behavior A clear and concise description of what you expected to happen.

    Screenshots If applicable, add screenshots to help explain your problem. image

    System

    • OS: Ubuntu
    • Browser: command line
    • Version: Laravel 5.8, pragmarx/tracker: 3.3

    Additional context Add any other context about the problem here.

    opened by khoazero123 11
  • Custom tracking

    Custom tracking

    Hi,

    Very nice package

    I am trying to integrate it into my CMS

    Is there a way to track things that are not in the config file?

    I want to track things that have dynamic routes and events.

    Is there some way to directly call the tracking functions?

    Something like Tracker::trackEvent('cart.add',$data) or i want to track page view with something like Tracker::trackVisit('my/dynamic/url')

    Are there some methods like that and a way to call them on runtime?

    opened by peter-mw 11
  • Tracker and Zizaco confide

    Tracker and Zizaco confide

    Hi,

    I've just installed your package and it looks good. The main issue I got is that nothing is logged to DB.

    I've got no errors or anything like that... In tracker config file I've edited user model to 'user_model' => 'Zizaco\Confide\Zizaco\Confide\ConfideUser',

    but it didn't helped... I've enabled logging in config, this is my config http://laravel.io/bin/YJPbd

    opened by RokSiEu 11
  •  Jenssegers/agent added isPhone() support, breaks Tracker isPhone()

    Jenssegers/agent added isPhone() support, breaks Tracker isPhone()

    It seems jenssegers/agent added isPhone() support and the following occurs after a composer update:

    Declaration of PragmaRX\Tracker\Support\MobileDetect::isPhone() should be compatible with Jenssegers\Agent\Agent::isPhone($userAgent = NULL, $httpHeaders = NULL)

    My current solution is to add: "jenssegers/agent": "2.1.*" to your own composer file. New functionality is from version 2.2.2 it seems.

    Is there going to be an update implementing the new version of jenssegers/agent?

    opened by EmielBlonk 10
  • Laravel 5 issues

    Laravel 5 issues

    Hi Antonio, great package you've made here. It worked quite well for me in Laravel 4. In Laravel 5 I am having a bit of issue getting it working completely. Specifically the views are not able to be found by Laravel.

    Everything work up until the controller tries to load the views. Then it tells me that the hint path for pragmarx/tracker doesn't exist. Am I missing something?

    The other thing that I thought may be related is when I vendor:publish I get the error:

    Can't locate path: </home/vagrant/sites/geroblee/vendor/pragmarx/tracker/src/Vendor/Laravel/../../migrations>
    
    opened by gerob 10
  • Session failure

    Session failure

    Hielloh... I installed this package to my Laravel 5 install. After everything is setup I get this Whoops:

    ErrorException in PhpSession.php line 42:
    open(/var/lib/php5/sess_8f47275035fa5381b33357961a8edec6, O_RDWR) failed: Permission denied (13)
    in PhpSession.php line 42
    at HandleExceptions->handleError('2', 'open(/var/lib/php5/sess_8f47275035fa5381b33357961a8edec6, O_RDWR) failed: Permission denied (13)', '/home/vagrant/www/gar.dev/vendor/pragmarx/support/src/PhpSession.php', '42', array())
    at session_start() in PhpSession.php line 42
    at PhpSession->startSession() in PhpSession.php line 33
    at PhpSession->__construct() in ServiceProvider.php line 263
    at {closure}(object(Application)) in Container.php line 290
    at {closure}(object(Application), array()) in Container.php line 773
    at Container->build(object(Container::share;1166578274), array()) in Container.php line 656
    at Container->make('tracker.repositories', array()) in Application.php line 613
    at Application->make('tracker.repositories') in Container.php line 1231
    at Container->offsetGet('tracker.repositories') in ServiceProvider.php line 142
    at {closure}(object(Application)) in Container.php line 290
    at {closure}(object(Application), array()) in Container.php line 773
    at Container->build(object(Container::share;1166578274), array()) in Container.php line 656
    at Container->make('tracker', array()) in Application.php line 613
    at Application->make('tracker') in Container.php line 1231
    at Container->offsetGet('tracker') in ServiceProvider.php line 585
    at ServiceProvider->getTracker() in ServiceProvider.php line 453
    at {closure}(object(Session))
    at call_user_func_array(object(ServiceProvider::registerGlobalEventLogger;977147613#2), array(object(Session))) in Dispatcher.php line 218
    at Dispatcher->fire('eloquent.booting: PragmaRX\Tracker\Vendor\Laravel\Models\Session', array(object(Session))) in Model.php line 1672
    at Model->fireModelEvent('eloquent.booting: PragmaRX\Tracker\Vendor\Laravel\Models\Session', false) in Model.php line 275
    at Model->bootIfNotBooted() in Model.php line 255
    at Model->__construct(array()) in Base.php line 12
    at Base->__construct(array()) in Session.php line 23
    at Session->__construct() in ServiceProvider.php line 394
    at ServiceProvider->instantiateModel('session_model') in ServiceProvider.php line 164
    at {closure}(object(Application)) in Container.php line 290
    at {closure}(object(Application), array()) in Container.php line 773
    at Container->build(object(Container::share;1166578274), array()) in Container.php line 656
    at Container->make('tracker.repositories', array()) in Application.php line 613
    at Application->make('tracker.repositories') in Container.php line 1231
    at Container->offsetGet('tracker.repositories') in ServiceProvider.php line 142
    at {closure}(object(Application)) in Container.php line 290
    at {closure}(object(Application), array()) in Container.php line 773
    at Container->build(object(Container::share;1166578274), array()) in Container.php line 656
    at Container->make('tracker', array()) in Application.php line 613
    at Application->make('tracker') in Container.php line 1231
    at Container->offsetGet('tracker') in ServiceProvider.php line 585
    at ServiceProvider->getTracker() in ServiceProvider.php line 543
    at ServiceProvider->bootTracker() in ServiceProvider.php line 75
    at ServiceProvider->boot()
    at call_user_func_array(array(object(ServiceProvider), 'boot'), array()) in Container.php line 523
    at Container->call(array(object(ServiceProvider), 'boot')) in Application.php line 672
    at Application->bootProvider(object(ServiceProvider)) in Application.php line 654
    at {closure}(object(ServiceProvider))
    at array_walk(array(object(EventServiceProvider), object(RoutingServiceProvider), object(AuthServiceProvider), object(ControllerServiceProvider), object(CookieServiceProvider), object(DatabaseServiceProvider), object(EncryptionServiceProvider), object(FilesystemServiceProvider), object(FormRequestServiceProvider), object(FoundationServiceProvider), object(PaginationServiceProvider), object(SessionServiceProvider), object(ValidationServiceProvider), object(ViewServiceProvider), object(AppServiceProvider), object(BusServiceProvider), object(ConfigServiceProvider), object(EventServiceProvider), object(RouteServiceProvider), object(AclServiceProvider), object(DatatablesServiceProvider), object(ServiceProvider), object(BusServiceProvider)), object(Application::boot;966196212)) in Application.php line 655
    at Application->boot() in BootProviders.php line 15
    at BootProviders->bootstrap(object(Application)) in Application.php line 167
    at Application->bootstrapWith(array('Illuminate\Foundation\Bootstrap\DetectEnvironment', 'Illuminate\Foundation\Bootstrap\LoadConfiguration', 'Illuminate\Foundation\Bootstrap\ConfigureLogging', 'Illuminate\Foundation\Bootstrap\HandleExceptions', 'Illuminate\Foundation\Bootstrap\RegisterFacades', 'Illuminate\Foundation\Bootstrap\RegisterProviders', 'Illuminate\Foundation\Bootstrap\BootProviders')) in Kernel.php line 199
    at Kernel->bootstrap() in Kernel.php line 110
    at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 84
    at Kernel->handle(object(Request)) in index.php line 53
    

    If I comment out session_start in PhpSession.php on line 42 I get rid of it.

    Here's my config:

    <?php
    
    return [
    
        /**
         * Enable it?
         */
        'enabled' => true,
    
        /**
         * Robots should be tracked?
         */
        'do_not_track_robots' => true,
    
        /**
         * Which environments are not trackable?
         */
        'do_not_track_environments' => [
            // defaults to none
        ],
    
        /**
         * Which routes names are not trackable?
         */
        'do_not_track_routes' => [
            'tracker.stats.*',
        ],
    
        /**
         * The Do Not Track Ips is used to disable Tracker for some IP addresses:
         *
         *     '127.0.0.1', '192.168.1.1'
         *
         * You can set ranges of IPs
         *     '192.168.0.1-192.168.0.100'
         *
         * And use net masks
         *     '10.0.0.0/32'
         *     '172.17.0.0/255.255.0.0'
         */
        'do_not_track_ips' => [
            '127.0.0.0/24' /// range 127.0.0.1 - 127.0.0.255
        ],
    
        /**
         * Log every single access?
         *
         * The log table can become huge if your site is popular, but...
         *
         * Log table is also responsible for storing information on:
         *
         *    - Routes and controller actions accessed
         *    - HTTP method used (GET, POST...)
         *    - Error log
         *    - URL queries (including values)
         */
        'log_enabled' => true,
    
        /**
         * Log SQL queries?
         *
         * Log must be enabled for this option to work.
         */
        'log_sql_queries' => false,
    
        /**
         * If you prefer to store Tracker data on a different database or connection,
         * you can set it here.
         *
         * To avoid SQL queries log recursion, create a different connection for Tracker,
         * point it to the same database (or not) and forbid logging of this connection in
         * do_not_log_sql_queries_connections.
         */
        'connection' => 'tracker',
    
        /**
         * Forbid logging of SQL queries for some connections.
         *
         * To avoid recursion, you better ignore Tracker connection here.
         *
         * Please create a separate database connection for Tracker. It can hit
         * the same database of your application, but the connection itself
         * has to have a different name, so the package can ignore its own queries
         * and avoid recursion.
         *
         */
        'do_not_log_sql_queries_connections' => [
            'tracker'
        ],
    
        /**
         * Also log SQL query bindings?
         *
         * Log must be enabled for this option to work.
         */
        'log_sql_queries_bindings' => false,
    
        /**
         * Log events?
         */
        'log_events' => false,
    
        /**
         * Which events do you want to log exactly?
         */
        'log_only_events' => [
            // defaults to logging all events
        ],
    
        /**
         * What are the names of the id columns on your system?
         *
         * 'id' is the most common, but if you have one or more different,
         * please add them here in your preference order.
         */
        'id_columns_names' => [
            'id'
        ],
        /**
         * Do not log events for the following patterns.
         * Strings accepts wildcards:
         *
         *    eloquent.*
         *
         */
        'do_not_log_events' => [
            'illuminate.log',
            'eloquent.*',
            'router.*',
            'composing: *',
            'creating: *',
        ],
    
        /**
         * Do you wish to log Geo IP data?
         *
         * You will need to install the geoip package
         *
         *     composer require "geoip/geoip":"~1.14"
         *
         * And remove the PHP module
         *
         *     sudo apt-get purge php5-geoip
         *
         */
        'log_geoip' => true,
    
        /**
         * Do you wish to log the user agent?
         */
        'log_user_agents' => true,
    
        /**
         * Do you wish to log your users?
         */
        'log_users' => false,
    
        /**
         * Do you wish to log devices?
         */
        'log_devices' => false,
    
        /**
         * Do you wish to log HTTP referers?
         */
        'log_referers' => false,
    
        /**
         * Do you wish to log url paths?
         */
        'log_paths' => false,
    
        /**
         * Do you wish to log url queries and query arguments?
         */
        'log_queries' => false,
    
        /**
         * Do you wish to log routes and route parameters?
         */
        'log_routes' => false,
    
        /**
         * Log errors and exceptions?
         */
        'log_exceptions' => false,
    
        /**
         * A cookie may be created on your visitor device, so you can have information
         * on everything made using that device on your site.    *
         */
        'store_cookie_tracker' => false,
    
        /**
         * If you are storing cookies, you better change it to a name you of your own.
         */
        'tracker_cookie_name' => 'stats_tracker',
    
        /**
         * Internal tracker session name.
         */
        'tracker_session_name' => 'tracker_session',
    
        /**
         * ** IMPORTANT **
         *   Change the user model to your own.
         */
        'user_model' => 'Webbish\Users\User',
    
        /**
         * You can use your own model for every single table Tracker has.
         */
    
        'session_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Session',
    
        'log_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Log',
    
        'path_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Path',
    
        'query_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Query',
    
        'query_argument_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\QueryArgument',
    
        'agent_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Agent',
    
        'device_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Device',
    
        'cookie_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Cookie',
    
        'domain_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Domain',
    
        'referer_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Referer',
    
        'route_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Route',
    
        'route_path_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\RoutePath',
    
        'route_path_parameter_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\RoutePathParameter',
    
        'error_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Error',
    
        'geoip_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\GeoIp',
    
        'sql_query_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\SqlQuery',
    
        'sql_query_binding_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\SqlQueryBinding',
    
        'sql_query_binding_parameter_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\SqlQueryBindingParameter',
    
        'sql_query_log_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\SqlQueryLog',
    
        'connection_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Connection',
    
        'event_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Event',
    
        'event_log_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\EventLog',
    
        'system_class_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\SystemClass',
    
        /**
         * Laravel internal variables on user authentication and login.
         */
        'authentication_ioc_binding' => 'auth', // defaults to 'auth' in Illuminate\Support\Facades\Auth
    
        'authenticated_check_method' => 'check', // to Auth::check()
    
        'authenticated_user_method' => 'user', // to Auth::user()
    
        'authenticated_user_id_column' => 'id', // to Auth::user()->id
    
        'authenticated_user_username_column' => 'email', // to Auth::user()->email
    
        /**
         * Enable the Stats Panel?
         */
        'stats_panel_enabled' => false,
    
        /**
         * Stats Panel routes before filter
         *
         */
        'stats_routes_before_filter' => '',
    
        /**
         * Stats Panel routes after filter
         *
         */
        'stats_routes_after_filter' => '',
    
        /**
         * Stats Panel routes middleware
         *
         */
        'stats_routes_middleware' => '',
    
        /**
         * Stats Panel template path
         */
        'stats_template_path' => '/templates/sb-admin-2',
    
        /**
         * Stats Panel base uri.
         *
         * If your site url is http://wwww.mysite.com, then your stats page will be:
         *
         *    http://wwww.mysite.com/stats
         *
         */
        'stats_base_uri' => 'stats',
    
        /**
         * Stats Panel layout view
         */
        'stats_layout' => 'pragmarx/tracker::layout',
    
        /**
         * Stats Panel controllers namespace
         */
        'stats_controllers_namespace' => 'PragmaRX\Tracker\Vendor\Laravel\Controllers',
    ];
    
    opened by rockymontana 9
  • i cant get pageviews ?

    i cant get pageviews ?

    i installed everything , but i can't get pageviews. which log options should i change from config/tracker.php to get post's page views ? ( all of them false now ) should i activate logs to get page views ? what i want to do is getting posts's page views.. it always display 0 to me. i'm working on my local , i deleted 'do_not_track_ips'

    my code : Routes

    Route::get('blog/{slug}', ['as' => 'blog.show', 'uses' => 'Frontend\BlogController@show']);
    

    blogcontroller

    
        public function show($slug)
        {
            //
            $post = $this->blogRepo->getBySlug($slug);
            $pageViews= \Tracker::logByRouteName('blog.show')
                    ->where(function($query)
                    {
                        $query
                                ->where('parameter', 'slug')
                                ->where('value', '$slug');
                    })
                    ->count();
    
            return view('frontend.blog-post' , compact('post'  , 'pageViews' ));
        }
    
    

    view

          <p class="post-views"> {{ $pageViews  }}</p>
    
    opened by oguzcicek 8
  • Add support for PHP 8.x and new Laravel version

    Add support for PHP 8.x and new Laravel version

    I'm using laravel project with php 8.x version and while installing this package it throw php version errors.

    λ composer require pragmarx/tracker
    Using version ^4.0 for pragmarx/tracker
    ./composer.json has been updated
    Running composer update pragmarx/tracker
    Loading composer repositories with package information
    Updating dependencies
    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - pragmarx/tracker v4.0.x-dev requires php ^7.0 -> your php version (8.1.2) does not satisfy that requirement.
        - pragmarx/tracker v4.0.0 requires laravel/framework ~5|~6|~7 -> found laravel/framework[v5.0.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev] but it conflicts with your root composer.json require (^8.75).
        - pragmarx/tracker v4.0.1 requires psr/log ~1.0 -> found psr/log[1.0.0, ..., 1.1.4] but the package is fixed to 2.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
        - Root composer.json requires pragmarx/tracker ^4.0 -> satisfiable by pragmarx/tracker[v4.0.0, v4.0.1, v4.0.x-dev].
    
    Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
    You can also try re-running composer require with an explicit version constraint, e.g. "composer require pragmarx/tracker:*" to figure out if any version is installable, or "composer require pragmarx/tracker:^2.1" if you know which you need.
    
    Installation failed, reverting ./composer.json and ./composer.lock to their original content.
    
    opened by Neeraj1005 4
  • PHP 8.1 is not working

    PHP 8.1 is not working

    Your requirements could not be resolved to an installable set of packages. Problem 1 - pragmarx/tracker v4.0.x-dev requires php ^7.0 -> your php version (8.1.2) does not satisfy that requirement. - pragmarx/tracker v4.0.0 requires laravel/framework ~5|~6|~7 -> found laravel/framework[v5.0.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev] but it conflicts with your root composer.json require (^8.65). - pragmarx/tracker v4.0.1 requires psr/log ~1.0 -> found psr/log[1.0.0, ..., 1.1.4] but the package is fixed to 2.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command. - Root composer.json requires pragmarx/tracker ^4.0 -> satisfiable by pragmarx/tracker[v4.0.0, v4.0.1, v4.0.x-dev].

    Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

    Screenshots image

    opened by azonedev 1
  • Using $this when not in object context

    Using $this when not in object context

    Describe the bug A clear and concise description of what the bug is.

    To Reproduce Steps to reproduce the behavior:

    1. Go to '...'
    2. Click on '....'
    3. Scroll down to '....'
    4. See error

    Expected behavior A clear and concise description of what you expected to happen.

    Screenshots If applicable, add screenshots to help explain your problem.

    System

    • OS: [e.g. iOS]
    • Browser [e.g. chrome, safari]
    • Version [e.g. 22]

    Additional context Add any other context about the problem here.

    opened by Morrowga 2
Releases(v4.0.0)
Owner
Antonio Carlos Ribeiro
Antonio Carlos Ribeiro
Your users do not always report errors, LaraBug does. LaraBug is a simple to use and implement error tracker built for the Laravel framework.

Your users do not always report errors, LaraBug does. LaraBug is a simple to use and implement error tracker built for the Laravel framework. This rep

LaraBug 197 Dec 9, 2022
The best squirrel tracker. Ever. (A demo app for LaravelSF meetups)

LaraSqrrl Identify and track squirrels via text, now using AWS Rekognition! Created for the November 10th, 2015; February 9th, 2016; May 10th, 2016; a

Paul Foryt 3 Mar 29, 2022
Attendance Tracker & Management System

Attendance Tracker & Management System Technologies used: HTML5, CSS3, PHP and MySQL. Project Description Attendance Tracker could be an award-winning

Saurabh Kishor 1 Oct 29, 2022
This is a simple Expense Tracker app.

Expense Tracker This is a simple Expense Tracker app build with Filament Admin (TALL Stack). Demo hosted on Heroku Demo Filament Expense Tracker Featu

Mohsin Shaikh 14 Dec 9, 2022
List of 77 languages for Laravel Framework 4, 5, 6, 7 and 8, Laravel Jetstream , Laravel Fortify, Laravel Breeze, Laravel Cashier, Laravel Nova and Laravel Spark.

Laravel Lang In this repository, you can find the lang files for the Laravel Framework 4/5/6/7/8, Laravel Jetstream , Laravel Fortify, Laravel Cashier

Laravel Lang 6.9k Jan 2, 2023
⚡ Laravel Charts — Build charts using laravel. The laravel adapter for Chartisan.

What is laravel charts? Charts is a Laravel library used to create Charts using Chartisan. Chartisan does already have a PHP adapter. However, this li

Erik C. Forés 31 Dec 18, 2022
Laravel Kickstart is a Laravel starter configuration that helps you build Laravel websites faster.

Laravel Kickstart What is Laravel Kickstart? Laravel Kickstart is a Laravel starter configuration that helps you build Laravel websites faster. It com

Sam Rapaport 46 Oct 1, 2022
Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

null 9 Dec 14, 2022
Laravel Segment is an opinionated, approach to integrating Segment into your Laravel application.

Laravel Segment Laravel Segment is an opinionated, approach to integrating Segment into your Laravel application. Installation You can install the pac

Octohook 13 May 16, 2022
Laravel Sanctum support for Laravel Lighthouse

Lighthouse Sanctum Add Laravel Sanctum support to Lighthouse Requirements Installation Usage Login Logout Register Email Verification Forgot Password

Daniël de Wit 43 Dec 21, 2022
Bring Laravel 8's cursor pagination to Laravel 6, 7

Laravel Cursor Paginate for laravel 6,7 Installation You can install the package via composer: composer require vanthao03596/laravel-cursor-paginate U

Pham Thao 9 Nov 10, 2022
A package that uses blade templates to control how markdown is converted to HTML inside Laravel, as well as providing support for markdown files to Laravel views.

Install Install via composer. $ composer require olliecodes/laravel-etched-blade Once installed you'll want to publish the config. $ php artisan vendo

Ollie Codes 19 Jul 5, 2021
A light weight laravel package that facilitates dealing with arabic concepts using a set of classes and methods to make laravel speaks arabic

A light weight laravel package that facilitates dealing with arabic concepts using a set of classes and methods to make laravel speaks arabic! concepts like , Hijri Dates & Arabic strings and so on ..

Adnane Kadri 49 Jun 22, 2022
Jetstrap is a lightweight laravel 8 package that focuses on the VIEW side of Jetstream / Breeze package installed in your Laravel application

A Laravel 8 package to easily switch TailwindCSS resources generated by Laravel Jetstream and Breeze to Bootstrap 4.

null 686 Dec 28, 2022
Laravel Jetstream is a beautifully designed application scaffolding for Laravel.

Laravel Jetstream is a beautifully designed application scaffolding for Laravel. Jetstream provides the perfect starting point for your next Laravel application and includes login, registration, email verification, two-factor authentication, session management, API support via Laravel Sanctum, and optional team management.

The Laravel Framework 3.5k Jan 8, 2023
Laravel Larex lets you translate your whole Laravel application from a single CSV file.

Laravel Larex Translate Laravel Apps from a CSV File Laravel Larex lets you translate your whole Laravel application from a single CSV file. You can i

Luca Patera 68 Dec 12, 2022
A Laravel package that adds a simple image functionality to any Laravel model

Laraimage A Laravel package that adds a simple image functionality to any Laravel model Introduction Laraimage served four use cases when using images

Hussein Feras 52 Jul 17, 2022
A Laravel extension for using a laravel application on a multi domain setting

Laravel Multi Domain An extension for using Laravel in a multi domain setting Description This package allows a single Laravel installation to work wi

null 658 Jan 6, 2023
Example of using abrouter/abrouter-laravel-bridge in Laravel

ABRouter Laravel Example It's a example of using (ABRouter Laravel Client)[https://github.com/abrouter/abrouter-laravel-bridge] Set up locally First o

ABRouter 1 Oct 14, 2021