PHPackages                             yousefpackage/visits - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. yousefpackage/visits

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

yousefpackage/visits
====================

This package is for controlling everything related to website visits using the Laravel framework

639PHP

Since Jul 4Pushed 4y ago2 watchersCompare

[ Source](https://github.com/y0usefalsaadany/visits-package)[ Packagist](https://packagist.org/packages/yousefpackage/visits)[ RSS](/packages/yousefpackage-visits/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

install package
===============

[](#install-package)

```
composer require yousefpackage/visits

```

then goto config folder
=======================

[](#then-goto-config-folder)

in app.php

write this in $routeMiddleware

```
'providers' => [

Yousefpackage\Visits\VisitServiceProvider::class,
Yousefpackage\Visits\RoutePackageServiceProvider::class,

],

```

then goto kernel.php
====================

[](#then-goto-kernelphp)

write this in $routeMiddleware

```
'visit' => \Yousefpackage\Visits\Http\Middleware\VistsMiddleware::class,

```

then run this command
=====================

[](#then-run-this-command)

```
php artisan migrate

```

test package
============

[](#test-package)

now for test this package goto your browser and write this visits-package

```
http://127.0.0.1:8000/visits-package

```

using
=====

[](#using)

Now Put this middleware on the route you want to calculate the number of views for.

```
->middleware('throttle:visit', 'visit');

```

like this

```
Route::get('/', function () {
    return view('welcome');
})->middleware('throttle:visit', 'visit');

```

If you want to calculate the number of views you have, make a controller and then put this code

```
