HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/vebon.komma.pro/app/KommaApp/Core/Middleware/SecureMiddleWare.php
<?php

namespace KommaApp\Core\Middleware;

use Closure;
use Illuminate\Http\Request;

class SecureMiddleware
{

    /**
     * In this method, that is fired before the request.
     * We are going to check if there is an db alias.
     * If true, we will fire a modified request.
     * If not, we check for an alternative route
     * and redirect with a 301
     *
     * @param         $request
     * @param Closure $next
     * @return mixed
     */
    public function handle(Request $request, Closure $next)
    {
        if( ! \Request::secure() && getenv('APP_ENV') == 'production')
        {
            return \Redirect::secure(\Request::path(),301);
        }

        return $next($request);
    }

}