PHP Classes

Redbox PHP Track Website Visitors: Track the arrival of users visiting a Web site

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 150 All time: 9,086 This week: 660Up
Version License PHP version Categories
redbox-tracker 1.0MIT/X Consortium ...7.3User Management, PHP 7
Description 

Author

This package can track the arrival of users visiting a Web site.

It allows to register a class that will handle events triggered when a new visitor arrives to a Website.

The package will call a function of the given handler class, so applications can perform a custom action when a new user arrives.

It also records on a database table details of each new visiting user, so it can distinguish which are the new users from users that have already visited the site.

Innovation Award
PHP Programming Innovation award nominee
May 2020
Number 5
Some Web sites provide information about the users that access the site. For instance they can provide statistics about the number of users that have accessed the site in a given period, such as in the last day, week or month.

This package provides a flexible solution that allows applications implement custom actions when a new user or a returning user visits the current Web site.

Manuel Lemos
Picture of Johnny Mast
  Performance   Level  
Name: Johnny Mast <contact>
Classes: 10 packages by
Country: The Netherlands The Netherlands
Age: 42
All time rank: 121534 in The Netherlands The Netherlands
Week rank: 197 Up4 in The Netherlands The Netherlands Up
Innovation award
Innovation award
Nominee: 5x

Documentation

<h2 align="center"> <img src="https://user-images.githubusercontent.com/121194/82691564-6b57da80-9c5e-11ea-87ec-639ad2255e8a.png"><br /> Tracking Movement </h2>

<p align="center"> <a href="https://github.com/johnnymast/redbox-tracker/actions?query=workflow%3APhpcs"><img src="https://github.com/johnnymast/redbox-tracker/workflows/Phpcs/badge.svg" /></a> <a href="https://scrutinizer-ci.com/g/johnnymast/redbox-tracker/?branch=master"><img src="https://scrutinizer-ci.com/g/johnnymast/redbox-tracker/badges/quality-score.png?b=master" /></a> <a href="https://scrutinizer-ci.com/g/johnnymast/redbox-tracker/?branch=master"><img src="https://scrutinizer-ci.com/g/johnnymast/redbox-tracker/badges/coverage.png?b=master" /></a> <a href="https://scrutinizer-ci.com/g/johnnymast/redbox-tracker/build-status/master"><img src="https://scrutinizer-ci.com/g/johnnymast/redbox-tracker/badges/build.png?b=master" /></a> </p>

Redbox-tracker allows helps you to track visiting traffic to your Laravel website. New visitors along with their requests will be saved to the database.

Getting started

Prerequisites

We don't require much, but these are the minimum requirements for using Redbox-tracker.

  • PHP 7.3
  • Laravel 7 or higher

There is one additional requirement if you are contributing to this package. For development on the package itself, we require <code>pdo_sqlite</code> for testing.

Installation

The package can be installed using composer.

composer require redbox/tracker

The package will automatically register itself.

Publish configuration file:

php artisan vendor:publish --provider="Redbox\Tracker\Providers\TrackerServiceProvider"

Install the database tables:

php artisan migrate

Create a listener for new visitors in your project:

php artisan make:listener NewVisitorListener

In <code>App\Providers\EventServiceProvider</code> and update the <code>$listen</code> array with:

    protected $listen = [
        // --
        \Redbox\Tracker\Events\NewVisitorEvent::class => [
            \App\Listeners\NewVisitorListener::class,
        ]
        // --
    ];

In <code>App\Listeners\NewVisitorListener</code> you now have access to the visitor data from <code>$event->visitor</code>.

    /
     * Handle the event.
     *
     * @param  object  $event
     * @return void
     */
    public function handle($event)
    {
        dd($event->visitor);
    }

Documentation

For more detailed information about how to use this package, I would like to send you to the project wiki.

Disclaimer

This project is inspired by Laravel Visitor Tracker. I created this version of this software because I need that functionality for a project of my own. This means I want all my dependencies for that projects 'Inhouse'.

Author

This package is created and maintained by Johnny Mast. For feature requests or suggestions you could consider sending me an e-mail.

Enjoy

Oh and if you've come down this far, you might as well follow me on Twitter. If you like this software please consider giving it a start rating on GitHub.

License

MIT License

Copyright (c) 2020 Johnny Mast

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


  Files folder image Files (30)  
File Role Description
Files folder image.github (1 file, 1 directory)
Files folder imagedatabase (2 directories)
Files folder imagepublishable (1 directory)
Files folder imagesrc (3 files, 5 directories)
Files folder imagetests (1 file, 1 directory)
Accessible without login Plain text file .scrutinizer.yml Data Auxiliary data
Accessible without login Plain text file .stylelintrc.json Data Auxiliary data
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file CHANGELOG.md Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file eslintrc.json Data Auxiliary data
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file package.json Data Auxiliary data
Accessible without login Plain text file phpcs.xml.dist Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (30)  /  .github  
File Role Description
Files folder imageworkflows (1 file)
  Accessible without login Plain text file FUNDING.yml Data Auxiliary data

  Files folder image Files (30)  /  .github  /  workflows  
File Role Description
  Accessible without login Plain text file Phpcs.yaml Data Auxiliary data

  Files folder image Files (30)  /  database  
File Role Description
Files folder imagefactories (1 file)
Files folder imagemigrations (2 files)

  Files folder image Files (30)  /  database  /  factories  
File Role Description
  Plain text file VisitorFactory.php Class Class source

  Files folder image Files (30)  /  database  /  migrations  
File Role Description
  Plain text file 2020_05_15_222804_..._visitors_table.php Class Class source
  Plain text file 2020_05_17_175544_..._requests_table.php Class Class source

  Files folder image Files (30)  /  publishable  
File Role Description
Files folder imageconfig (1 file)

  Files folder image Files (30)  /  publishable  /  config  
File Role Description
  Accessible without login Plain text file tracker.php Conf. Configuration script

  Files folder image Files (30)  /  src  
File Role Description
Files folder imageEvents (1 file)
Files folder imageFacades (1 file)
Files folder imageMiddleware (1 file)
Files folder imageObservers (1 file)
Files folder imageProviders (1 file)
  Plain text file Tracker.php Class Class source
  Plain text file Visitor.php Class Class source
  Plain text file VisitorRequest.php Class Class source

  Files folder image Files (30)  /  src  /  Events  
File Role Description
  Plain text file NewVisitorEvent.php Class Class source

  Files folder image Files (30)  /  src  /  Facades  
File Role Description
  Plain text file Tracker.php Class Class source

  Files folder image Files (30)  /  src  /  Middleware  
File Role Description
  Plain text file TrackingMiddleware.php Class Class source

  Files folder image Files (30)  /  src  /  Observers  
File Role Description
  Plain text file VisitorObserver.php Class Class source

  Files folder image Files (30)  /  src  /  Providers  
File Role Description
  Plain text file TrackerServiceProvider.php Class Class source

  Files folder image Files (30)  /  tests  
File Role Description
Files folder imageFeature (1 file, 3 directories)
  Plain text file TestCase.php Class Class source

  Files folder image Files (30)  /  tests  /  Feature  
File Role Description
Files folder imageEventts (1 file)
Files folder imageMiddleware (1 file)
Files folder imageObservers (1 file)
  Plain text file TrackerTest.php Class Class source

  Files folder image Files (30)  /  tests  /  Feature  /  Eventts  
File Role Description
  Plain text file NewVisitorEventTest.php Class Class source

  Files folder image Files (30)  /  tests  /  Feature  /  Middleware  
File Role Description
  Plain text file TrackingMiddlewareTest.php Class Class source

  Files folder image Files (30)  /  tests  /  Feature  /  Observers  
File Role Description
  Plain text file VisitorObserverTest.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:150
This week:0
All time:9,086
This week:660Up