I'm having problems with Https requests in Laravel 5.1
I created a Middleware like this:
<?phpnamespace Subway\Http\Middleware;use Closure;use App;use Redirect;class UseSSL{ public function handle($request, Closure $next) { if (!$request->secure() && env('APP_ENV') === 'local') { return redirect()->secure($request->getRequestUri()); } return $next($request); }}
and my routes are like this:
Route::group(['middleware' => 'use.ssl'], function () {// All other routes here});
I registered the middleware in kernel.php
protected $routeMiddleware = ['use.ssl' => \Subway\Http\Middleware\UseSSL::class, ];
When trying to get to any url, the page doesn't load and the terminal is returning this error:
[Thu Nov 12 11:09:30 2015] ::1:50728 Invalid request (Unsupported SSL request)
What's the problem with this?