Skip to content

Latest commit

 

History

History
124 lines (66 loc) · 1.71 KB

README.md

File metadata and controls

124 lines (66 loc) · 1.71 KB

#Visitor

Register your visitors, Page hists, and count for Laravel 4

Installation

The recommended way to install Winput is through composer.

Step 1

Just add to composer.json file:

{
    "require": {
        "weboap/visitor": "dev-master"
    }
}

then run

php composer.phar update

Step 2

Add

'Weboap\Visitor\VisitorServiceProvider'

to the list of service providers in app/config/app.php

Step 3

Migrate the Visitor Table Run

php artisan migrate --package="weboap/visitor"

to migrate visitor table

Step 4

Publish Configuration

Run

php artisan config:publish weboap/visitor

to publish config to

app/config/packages/weboap/visitor

Step 5 (Optional)

Visit http://dev.maxmind.com/geoip/geoip2/geolite2/

download GeoLite2-City.mmdb

place it in

app/storage/geo/

or where ever you want just adjust the package config to reflect the new location, it's used to geo locate visitors

Usage

Visitor::log();   //log in db visitor ip, geo location, hit counter


Visitor::get();
Visitor::get( $ip );   //fetch ip record



Visitor::forget( $ip ); //delete ip from log


Visitor::has( $ip );   // checkk if visitor ip exist in log


Visitor::count()  // return count of all site registred unique visitors


Visitor::all();  // all records


Visitor::clicks(); //total of all clicks


Visitor::range($date_start, $date_end); // visitors count in a date range;

###Credits This product Uses GeoLite2 data created by MaxMind, whenever available.

Enjoy!