jeudi 4 février 2016

Laravel 5 middleware error

I keep getting an error every time I use myroute middleware. Below is the middleware class. its currently empty.

<?php
namespace App\Http\Middleware;

use Closure;

class EnforceHttps
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {

        return $next($request);
    }
}

When I attach it to my route like so it gives me an error.

Route::get('/', ['middleware' =>'https',function () {
//Route::get('/', function () {
    return view('launch');
}]);

If I uncomment the line below which does not include the middleware instead all is good. Why is this?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1K1AHYF
via IFTTT

Aucun commentaire:

Enregistrer un commentaire