That class is depreceted since version 5.1
https://laravel.com/api/5.1/Illuminate/Contracts/Routing/Middleware.html
Hey
I m running through a TuT on OAuth Api with Lumen and hit a snag
The TUT is here : http://esbenp.github.io/2015/05/26/lumen-web-api-oauth-2-authentication/
FatalErrorException in OAuthExceptionHandlerMiddleware.php line 13: Interface 'Illuminate\Contracts\Routing\Middleware' not found
<?php
namespace LucaDegasperi\OAuth2Server\Middleware;
use Closure;
use Illuminate\Http\JsonResponse;
use Illuminate\Contracts\Routing\Middleware;
use League\OAuth2\Server\Exception\OAuthException;
/*
* OAuthExceptionHandlerMiddleware
*/
class OAuthExceptionHandlerMiddleware implements Middleware
{
public function handle($request, Closure $next)
{
try {
return $next($request);
} catch (OAuthException $e) {
return new JsonResponse([
'error' => $e->errorType,
'error_description' => $e->getMessage()
],
$e->httpStatusCode,
$e->getHttpHeaders()
);
}
}
}
Please or to participate in this conversation.