dvlpp/privat

This package is abandoned and no longer maintained. No replacement package was suggested.

Simple private access package for Laravel.

Maintainers

Details

github.com/dvlpp/privat

Source

Issues

Installs: 3 050

Dependents: 0

Suggesters: 0

Security: 0

Stars: 6

Watchers: 2

Forks: 2

Open Issues: 0

Type:project

v1.0 2017-10-16 14:24 UTC

This package is not auto-updated.

Last update: 2020-01-23 17:26:40 UTC


README

This package is deprecated, a backward compatible v2 version of it is available here: code16/privat

Privat

Private is a very simple password protection for Laravel projects. It's useful for websites in a staging state.

Screenshot

Usage

Install with composer

composer require dvlpp/privat

Add Privat Service Provider (except for Laravel 5.5+)

Add the following line in the providers section of your config/app.php file:

\Dvlpp\Privat\PrivatServiceProvider::class

Add Privat middleware in your project

Add the following line at the end of the $middleware array of the app/Http/Kernel file:

\Dvlpp\Privat\PrivatMiddleware::class

Set Privat config

First create the privat config file:

php artisan vendor:publish --provider="Dvlpp\Privat\PrivatServiceProvider"

And then edit the new /config/privat.php accordingly (nothing fancy), or even better, add this keys in your .env file:

  • PRIVAT_RESTRICTED=true
  • PRIVAT_PASSWORD=mypassword

Exceptions

The except config param is meant to contain an array of excluded urls (those url won't be protected by Privat).

How does it work

Quite simple: if the given password is correct, Privat sets a session property, and look for it on each request. So, obviously, Privat won't work on non session based systems (an API for instance).

License

WTFPL