mohamedhk2/laravel-prod-tools

v1.0.6 2024-09-05 14:10 UTC

This package is auto-updated.

Last update: 2025-03-05 14:37:25 UTC


README

Total Downloads Latest Unstable Version License

Packages

anhskohbo/no-captcha
cviebrock/eloquent-sluggable
diglactic/laravel-breadcrumbs
ecrmnn/laravel-https
intervention/image
jorenvanhocht/laravel-share
laravel/ui
mcamara/laravel-localization
redcenter/laravel-non-www-redirect
spatie/laravel-medialibrary
spatie/laravel-translatable

Removed packages

packagereplaced byversionreason
morningtrain/laravel-httpsNone^1.0.6Not support Laravel ^11.x
morningtrain/laravel-httpsecrmnn/laravel-httpsonly v1.0.3Not support Laravel ^9.x

Install

The recommended way to install this is through composer:

composer require "mohamedhk2/laravel-prod-tools"

Laravel Force SSL

using ecrmnn/laravel-https - Add under `providers` in `config/app.php` ```php /* * Package Service Providers... */ \Ecrmnn\LaravelHttps\Providers\ServiceProvider::class, ``` - **Register the middleware as a global middleware in :** - **Laravel 10** and below: `App\Http\Kernel.php` ```php protected $middleware = [ ... \Ecrmnn\LaravelHttps\Http\Middleware\ForceHttps::class, ]; ``` - **Laravel 11** and above : `bootstrap/app.php` ```php ->withMiddleware(function (Middleware $middleware) { $middleware->use([ ... \Ecrmnn\LaravelHttps\Http\Middleware\ForceHttps::class, ]) ``` - **Update** the following in your `.env`: :warning: *HTTPS will only be forced when `env('HTTPS')` is set to `true`* :warning: ```dotenv # used by ecrmnn/laravel-https HTTPS=true ```

Laravel non-WWW Redirect

  • Deploy the config file: ^1.0.5

    php artisan vendor:publish --provider="Mohamedhk2\LaravelProdTools\Providers\NonWwwRedirectServiceProvider"
    # OR
    php artisan vendor:publish --tag=hk2-www
    
  • Add the middleware class: ^1.0.5

    • Laravel 10 and below: App\Http\Kernel.php
      protected $middlewareGroups = [
          'web' => [
              ...
              \Mohamedhk2\LaravelProdTools\Middlewares\LaravelNonWwwRedirectMiddleware::class,
          ],
      ];
      
    • Laravel 11 and above : bootstrap/app.php
      ->withMiddleware(function (Middleware $middleware) {
        $middleware->web([
            ...
            \Mohamedhk2\LaravelProdTools\Middlewares\LaravelNonWwwRedirectMiddleware::class,
        ]);
      })
      
  • Update the following in your .env: ^1.0.5

      REDIRECT_TO_WWW=true
    

License

The Laravel Prod Tools is open-sourced software licensed under the MIT license