{"repo":"coderflexx/laravisit","free":true,"listed":false,"github":"https://github.com/coderflexx/laravisit","clone":"git clone https://github.com/coderflexx/laravisit.git","description":"Track page views, visitors, and audience analytics with an elegant Laravel package","language":"PHP","stars":434,"topics":["laravel","eloquent","analytics","php","laravel-package","page-views","statistics","visitor-tracking"],"license":"MIT","category":"analytics","readme_excerpt":"A clean way to track your pages & understand your user's behavior Installation You can install the package via composer: You can publish the config file with: then, run database migration This is the contents of the published config file: Usage Use HasVisits Trait The first thing you need to do is, to use HasVisits trait, and implement CanVisit interface. After this step, you are all set, you can now count visits by using visit method You can chain methods to the visit method. Here are a list of the available methods: METHOD SYNTAX DESCRIPTION EXAMPLE ----------- ----------- ----------- ----------- withIp() string $ip = null Set an Ip address (default request()- ip() ) $post- visit()- withIp() withSession() string $session = null Set an Session ID (default session()- getId() ) $post- visit()- withSession() withData() array $data Set custom data $post- visit()- withData(['region' = 'USA']) withUser() Model $user = null Set a user model (default auth()- user() ) $user- visit()- withUser() --- By default, you will have unique visits each day using dailyInterval() method. Meaning, when the users access the page multiple times in a day time frame, you will see just one record related to them. If you want to log users access to a page with different timeframes , here are a bunch of useful methods: METHOD SYNTAX DESCRIPTION EXAMPLE ----------- ----------- ----------- ----------- hourlyInterval() void Log visits each hour $post- visit()- hourlyIntervals()- withIp(); dailyInterval() v","default_branch":null,"files":null,"tree":[],"storefront":"/r/coderflexx","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/coderflexx/laravisit/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}