PHP code example of jrl05k / laravel-under-construction

1. Go to this page and download the library: Download jrl05k/laravel-under-construction library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jrl05k / laravel-under-construction example snippets


  'providers' => [
    ...
    ...
    /*
     * Other Service Providers...
     */
    UnderConstruction\UnderConstructionProvider::class,  
    ...
    ...

  protected $middlewareGroups = [
    'web' => [
      ...
      \UnderConstruction\RedirectIfUnderConstructionMiddleware::class
      ...

    $routeMiddleware => [
      ...
      'under-construction' => \UnderConstruction\RedirectIfUnderConstructionMiddleware::class, 
      ...
  

    Route::get('/', function () {
      return view('welcome');
    });

    Route::group(['middleware'=>'under-construction'], function() {
      // the routes you want protected...    
      Route::get('/some-page', ...
      Route::get('/another-page', ...
      ...
    });