Looking to hire Laravel developers? Try LaraJobs

laravel-visitcounter maintained by taymaz

Description
laravel package to count pages and posts visits
Author
Last update
2023/06/30 11:47 (dev-main)
License
Links
Downloads
5

Comments
comments powered by Disqus

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

laravel-visitcounter

laravel package to count pages and posts visits

Install

From your terminal:

composer require taymaz/laravel-visitcounter

This starts to install laravel-visitcounter package its working with composer so you can use it to easy.

Basic use

for starting you need to create a file named config to setup backup options like directories and backup export path and ...

First publish package service provider

You have to this part of code in config/app.php

Taymaz\Visitcounter\VisitCounterServiceProvider::class,

then set middleware

package provide middleware to count each visits from your particular route./n example:

Route::get('/hello', [HelloWorld::class, 'hello'])->middleware('visitcount');

give middleware visitcount \n it can handle uri passed parameters.

get visits result

have easy acess for route visits in your controller.

public function hello(Request $request){
    $request->input('views'); //465
}