Simple private access package for Laravel.
This package is deprecated, a backward compatible v2 version of it is available here: code16/privat
Private is a very simple password protection for Laravel projects. It's useful for websites in a staging state.
composer require dvlpp/privat
Add the following line in the
providers section of your
Add the following line at the end of the
$middleware array of the
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
except config param is meant to contain an array of excluded urls
(those url won't be protected by Privat).
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).