PHP code example of infinity-it / laravel-prod-tools

1. Go to this page and download the library: Download infinity-it/laravel-prod-tools 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/ */

    

infinity-it / laravel-prod-tools example snippets


    /*
     * Package Service Providers...
     */
    \Ecrmnn\LaravelHttps\Providers\ServiceProvider::class,
    

          protected $middleware = [
              ...
              \Ecrmnn\LaravelHttps\Http\Middleware\ForceHttps::class,
          ];
        

        ->withMiddleware(function (Middleware $middleware) {
          $middleware->use([
              ...
              \Ecrmnn\LaravelHttps\Http\Middleware\ForceHttps::class,
          ])
        

      protected $middlewareGroups = [
          'web' => [
              ...
              \Mohamedhk2\LaravelProdTools\Middlewares\LaravelNonWwwRedirectMiddleware::class,
          ],
      ];
      

      ->withMiddleware(function (Middleware $middleware) {
        $middleware->web([
            ...
            \Mohamedhk2\LaravelProdTools\Middlewares\LaravelNonWwwRedirectMiddleware::class,
        ]);
      })
      
 bash
  php artisan vendor:publish --provider="Mohamedhk2\LaravelProdTools\Providers\NonWwwRedirectServiceProvider"
  # OR
  php artisan vendor:publish --tag=hk2-www
  
dotenv
    REDIRECT_TO_WWW=true