在将Laravel 5.1更新到5.2时出现此错误。
Macroable.php第74行中的BadMethodCallException: 方法过滤器不存在
有什么帮助吗?
这是堆栈跟踪
Macroable.php第74行中的BadMethodCallException:方法过滤器不存在。
in Macroable.php line 74
at Router->__call('filter', array('auth', object(Closure))) in Facade.php line 219
at Router->filter('auth', object(Closure)) in Facade.php line 219
at Facade::__callStatic('filter', array('auth', object(Closure))) in RouteServiceProvider.php line 56
at Route::filter('auth', object(Closure)) in RouteServiceProvider.php line 56
at RouteServiceProvider->boot(object(Router))
at call_user_func_array(array(object(RouteServiceProvider), 'boot'), array(object(Router))) in Container.php line 507
at Container->call(array(object(RouteServiceProvider), 'boot')) in Application.php line 757
at Application->bootProvider(object(RouteServiceProvider)) in Application.php line 740
at Application->Illuminate\Foundation\{closure}(object(RouteServiceProvider), '18')
at array_walk(array(object(EventServiceProvider), object(RoutingServiceProvider), object(AuthServiceProvider), object(CookieServiceProvider), object(DatabaseServiceProvider), object(EncryptionServiceProvider), object(FilesystemServiceProvider), object(FoundationServiceProvider), object(PaginationServiceProvider), object(SessionServiceProvider), object(ViewServiceProvider), object(LaravelPushNotificationServiceProvider), object(ImageServiceProvider), object(BarcodeServiceProvider), object(CloudderServiceProvider), object(AppServiceProvider), object(ConfigServiceProvider), object(EventServiceProvider), object(RouteServiceProvider)), object(Closure)) in Application.php line 741
at Application->boot() in BootProviders.php line 17
at BootProviders->bootstrap(object(Application)) in Application.php line 203
at Application->bootstrapWith(array('Illuminate\Foundation\Bootstrap\DetectEnvironment', 'Illuminate\Foundation\Bootstrap\LoadConfiguration', 'Illuminate\Foundation\Bootstrap\ConfigureLogging', 'Illuminate\Foundation\Bootstrap\HandleExceptions', 'Illuminate\Foundation\Bootstrap\RegisterFacades', 'Illuminate\Foundation\Bootstrap\RegisterProviders', 'Illuminate\Foundation\Bootstrap\BootProviders')) in Kernel.php line 232
at Kernel->bootstrap() in Kernel.php line 127
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 99
at Kernel->handle(object(Request)) in index.php line 53
答案 0 :(得分:0)
从堆栈跟踪中我得到了这个Route::filter('auth', object(Closure)) in RouteServiceProvider.php line 56
吗?因此,请检查行号RouteServiceProvider.php
中的56
文件。您有一个filter
通话。使用v5.2
代码对其进行更新。那应该可以解决您的问题。