sadekd/laravel-visitor

v1.1.1 2020-01-10 16:54 UTC

This package is auto-updated.

Last update: 2022-01-10 21:19:42 UTC


README

Installation

Require this package with composer.

composer require sadekd/laravel-visitor

Copy the package config to your local config with the publish command:

php artisan vendor:publish --provider="SadekD\LaravelVisitor\LaravelVisitorServiceProvider"

Usage

In App\Http\Kernel.php add this middleware

\SadekD\LaravelVisitor\Http\Middleware\VisitorMiddleware::class,

For all routes in web group:

protected $middlewareGroups = [
    'web' => [
        ['some laravel middlewares'],
        \SadekD\LaravelVisitor\Http\Middleware\VisitorMiddleware::class,
        ['other app middlewares'],
    ],
];

May be assigned to route groups or used individually:

protected $routeMiddleware = [
    ['some laravel middlewares'],
    'visitor' => \SadekD\LaravelVisitor\Http\Middleware\VisitorMiddleware::class,
    ['other app middlewares'],
];

License

The MIT License (MIT). Please see License File for more information.