Posts

Showing posts with the label Stats Tracker

Laravel Stats Tracker

Image
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 relatioships available: How you write your won method : <?php class Tracker Extends Eloquent {     public $attributes = ['hits' => 0];     protected $fillable = ['ip', 'date'];     public $timestamps = false;     protected $table = 'visitor';     public static function boot() {         // When a new instance of this model is created...         static::creating(function ($tracker) {             $tracker->hits = 0;         } );         // Any time the instance is saved (create OR update)