Under Construction Package

Packages

February 8th, 2018

Under Construction Package

This Laravel package by Lars Janssen, allows you to put your application in an “Under Construction” mode and then only users with the correct 4 digit code can access your site.

After you install it usage is pretty simple. Register your secret four digit number:

php artisan code:set 1234

Then, add the middleware to a route you want to restrict:

Route::group(['middleware' => 'under-construction'], function () {
Route::get('/live-site', function() {
echo 'content!';
});
});

This is a pretty cool package for those times when you want to share a site with clients and friends and for times when using a local share is not ideal.

For more information check out the GitHub repo.

Filed in:

Eric L. Barnes

Eric is the creator of Laravel News and has been covering Laravel since 2012.