3
0
Fork 0
This repository has been archived on 2024-11-14. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
ThemeParkPlus-Panel/app/Http/Middleware/HttpsProtocol.php
2020-02-26 14:59:58 +01:00

17 lines
366 B
PHP

<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\App;
class HttpsProtocol
{
public function handle($request, Closure $next)
{
if (!$request->secure() && in_array(App::environment(), ['stage', 'production']))
return redirect()->secure($request->getRequestUri());
return $next($request);
}
}