PHPackages                             balajidharma/laravel-viewable - 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. balajidharma/laravel-viewable

ActiveLibrary

balajidharma/laravel-viewable
=============================

Track Page views for your Laravel projects

v1.0.7(1y ago)24.4k↑15%2MITPHP

Since Dec 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/balajidharma/laravel-viewable)[ Packagist](https://packagist.org/packages/balajidharma/laravel-viewable)[ RSS](/packages/balajidharma-laravel-viewable/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (7)Dependencies (2)Versions (9)Used By (2)

Laravel Viewable
================

[](#laravel-viewable)

### Track Page views for your Laravel projects.

[](#track-page-views-for-your-laravel-projects)

[![Total Downloads](https://camo.githubusercontent.com/6ce3bdcd842ab653b4570c3cefa306a4712f720b823272ecedf7085c5d81d468/68747470733a2f2f706f7365722e707567782e6f72672f62616c616a69646861726d612f6c61726176656c2d7669657761626c652f646f776e6c6f616473)](https://packagist.org/packages/balajidharma/laravel-viewable)[![Latest Stable Version](https://camo.githubusercontent.com/836ee1e1215ebc88ba616be9a7c02c6bd364c2201e7ade9ed67ba16b1bc98a46/68747470733a2f2f706f7365722e707567782e6f72672f62616c616a69646861726d612f6c61726176656c2d7669657761626c652f762f737461626c65)](https://packagist.org/packages/balajidharma/laravel-viewable)[![License](https://camo.githubusercontent.com/53394946855b733d19713b699a1a315a41329e823b8eb6c31865c6ec21f57c18/68747470733a2f2f706f7365722e707567782e6f72672f62616c616a69646861726d612f6c61726176656c2d7669657761626c652f6c6963656e7365)](https://packagist.org/packages/balajidharma/laravel-viewable)

Credits
-------

[](#credits)

This package builds upon the work done in [cyrildewit/eloquent-viewable](https://github.com/cyrildewit/eloquent-viewable) and has been modified to suit specific needs. We are grateful to the original author and contributors for their work.

Features
--------

[](#features)

- Track page views for Laravel Eloquent models
- Configure unique views by IP, session, and authenticated users
- Bot detection and filtering
- Support for DNT (Do Not Track) header
- Configurable view counting and storage

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Configuration](#configuration-options)
- [Demo](#demo)

Installation
------------

[](#installation)

- Install the package via composer

```
composer require balajidharma/laravel-viewable
```

- Publish the migration with

```
php artisan vendor:publish --provider="BalajiDharma\LaravelViewable\ViewableServiceProvider" --tag="migrations"
```

- Run the migration

```
php artisan migrate
```

- To Publish the config/viewable.php config file with

```
php artisan vendor:publish --provider="BalajiDharma\LaravelViewable\ViewableServiceProvider" --tag="config"
```

- Preparing your model To associate views with a model, the model must implement the HasViewable trait:

```
