Download the PHP package foothing/laravel-simple-pageviews without Composer

On this page you can find all versions of the php package foothing/laravel-simple-pageviews. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-simple-pageviews

Laravel Simple Pageviews

Code Climate Test Coverage Build Status

Tracks page views of your Laravel 5.x app for traffic monitoring.

To date, it has been tested with Laravel up to 5.5 and PHP 7.

IMPORTANT If you are upgrading from previous 0.x version please read the release notes.

This package is meant for simple request tracking and not for in-depth traffic analysis. Features:

Each log record keeps track of the user session, user ip and date.

Setup

Install module:

composer require foothing/laravel-simple-pageviews

Add the service provider in config/app.php:

Publish migration and configuration files:

php artisan vendor:publish provider="Foothing\Laravel\Visits\ServiceProvider --tag="config"

php artisan vendor:publish provider="Foothing\Laravel\Visits\ServiceProvider --tag="migrations"

Run the migration:

php artisan migrate

Finally, add the middleware in your app/Http/Kernel.php:

Configure

In config/visits.php

Rules are meant to filter requests that you don't want to track. Default ones will filter out crawlers (thanks to https://github.com/JayBizzle/Crawler-Detect) and blacklisted urls.

Query methods

Each query method allows for date filtering and will accept up to 3 arguments.

Only exception is the aggregate() method, which will accept a limit argument.

Examples:

The input buffer

This package has been tested in a moderate traffic website, like ~20k pageviews / day which makes about 17k database records per day. The visits table will grow up pretty quick and the database might suffer performance issues when it comes to execute an insert or update statement on a table which count hundred thousands (or millions) rows.

For this reason an insert/update buffer has been added. Basically, each visit is tracked in a temporary table that is only used on write operations, while the report and read operations are performed on a separate table.

An artisan command has been added to handle the periodic data dump from the write table to the read table. A good practice might be dumping data each day.

TL;DR configure as follows in your app/Console/Kernel.php (please refer to Laravel docs for scheduling info):

Performances

Performances have been tested in a ~5 million records database with good results. However, i recommend to partition your database tables if size grows nasty, i.e. 1 milion record per partition. Also, a good practice would be to tune your partition to be consistent with date periods (i.e. full year in single partition, single quarter in single partition, etc.) according to your traffic and report type.

License

MIT


All versions of laravel-simple-pageviews with dependencies

PHP Build Version
Package Version
Requires illuminate/database Version >=5.1
illuminate/http Version >=5.1
foothing/laravel-repository Version >=0.8.0
nesbot/carbon Version ^1.21
jaybizzle/crawler-detect Version 1.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package foothing/laravel-simple-pageviews contains the following files

Loading the files please wait ....