, 나는 미들웨어ReflectionException - 미들웨어 클래스는 Laravel 존재하지 않습니다 5.2
응용 프로그램/HTTP/미들웨어/AuthenticateOnceWithBasicAuth.php
다음 만들었습니다<?php
namespace Illuminate\Auth\Middleware;
use Auth;
use Closure;
class AuthenticateOnceWithBasicAuth
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
return Auth::onceBasic() ?: $next($request);
}
}
그리고는
응용 프로그램/HTTP/kernel.php
을 Kernel.php 에 등록Route::group(['prefix' => 'admin', 'middleware' => 'auth.basic.once'], function() {
Route::get('service/create', function() {
return response()->json(['name' => 'Abigail', 'state' => 'CA'], 200);
});
});
을 다음과 같이
나는 길에서 그것을 사용하고 그러나 734 나에게 Container.php 라인
ReflectionException을주고있다 : \ AuthenticateOnceWithBasicAuth이
존재하지 않습니다 클래스 앱 \ HTTP를 미들웨어 \다음 명령을 실행했지만 성공하지 못했습니다.
composer dump-autoload
php artisan clear-compiled
php artisan optimize
모든 도움을 주시면 감사하겠습니다. 미리 감사드립니다.
:이 같은 것을 할 필요가 미들웨어에
:
이당신이 이름을 변경한다 터미널에서 "composer dump-auto"및 "php artisan clear-compiled"를 실행하십시오. 그것은 그것을 고쳐야한다. – IllegalPigeon
@IllegalPigeon 이미 시도했습니다 –