Code Monkey home page Code Monkey logo

redbox-tracker's Introduction


Tracking Movement

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 pdo_sqlite 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 App\Providers\EventServiceProvider and update the $listen array with:

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

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

    /**
     * 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.

redbox-tracker's People

Contributors

johnnymast avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

redbox-tracker's Issues

Add Unit tests

Yeah i know its a bit late but it still has to be done.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.