PHPackages                             samkitano/stats - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. samkitano/stats

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

samkitano/stats
===============

AWstats Parser for Laravel

3153[1 issues](https://github.com/samkitano/stats/issues)PHP

Since Jan 4Pushed 9y ago2 watchersCompare

[ Source](https://github.com/samkitano/stats)[ Packagist](https://packagist.org/packages/samkitano/stats)[ RSS](/packages/samkitano-stats/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

AWstats Log Files Parser for Laravel
====================================

[](#awstats-log-files-parser-for-laravel)

Reads your AWstats Log Files in [Laravel 4](http://laravel.com/) based applications.
------------------------------------------------------------------------------------

[](#reads-your-awstats-log-files-in-laravel-4-based-applications)

[AWstats](http://www.awstats.org/) is a well known open source application, designed to record and parse visitor statistics on your web site host. This Package makes those stats available for your Laravel application.

You should **NOT** use this package if you don't know what [AWstats](http://www.awstats.org/) is, how it works, and how to configure it. You **MUST**, at the very least, know the location of your **AWstats log files** in your host.

Since **AWstats** provides a quite extensive set of data, I would recommend a visit to [AWstats web page](http://www.awstats.org/) in order to get acquainted with it's features, setup and documentation.

Requirements
============

[](#requirements)

```
- PHP >= 5.4
- Laravel 4.2+.

```

Installation
============

[](#installation)

Add the following to the **require** section in your composer.json file

```
{
    "require": {
        "samkitano/stats": "dev-master"
    }
}
```

Update your dependencies

```
$ php composer.phar update
```

Open `app/config/app.php`, and add a new item to the providers array:

```
'Samkitano\Stats\StatsServiceProvider',

```

Publish configuration file:

```
$ php artisan config:publish samkitano/stats
```

You must also Publish the assets files:

```
$ php artisan asset:publish samkitano/stats
```

Assets like **AWstats** native icons will be then available on your `public/packages/Samkitano/Stats/assets` folder.

Configuration
=============

[](#configuration)

Package Settings are available in your `app/config/packages/Samkitano/Stats/config.php` file.

**AWstats log files path**

You must specify the path for the **AWstats** log files in your host. Usually something like `/home/USER/tmp/awstats/` where USER should be your host's username.

```
'AWstats_path' => '/home/USER/tmp/awstats/',
```

**Path to Icon images folder**

Set to `null` if you don't intend to display **AWstats** native icons.

```
'icon_path' => 'packages/Samkitano/Stats/assets/images/icon/',
```

**Icon Format**

Set to `'url'` if you want an url pointing to the icon files, or `'tag'` (default) if you prefer an ![]() html tag. The html ![]() tag will include the base64 encoded icon.

```
'icon_format' => 'tag',
```

**Units**

Set to true if you want human readable units for bandwidths. Set to false (default) if you intend to perform further calculations based on this results.

```
'units' => false,
```

Usage
=====

[](#usage)

To obtain a list of available log files:

```
