我对laravel 5.2很新,它一切正常,直到我尝试了laravelcollective / html。 我已经通过作曲家安装了它,突然间我无法访问我的根页面。
我已将这些添加到我的app / config.php中的提供者和别名数组
Collective\Html\HtmlServiceProvider::class,
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
这是我在composer.json中的require数组:
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"laravelcollective/html": "5.2"
},
我已经阅读了一个invole路由的解决方案:clear和cache:clear,但它不起作用。
这是完整的堆栈跟踪:
in Container.php line 738
at ReflectionClass->__construct('view') in Container.php line 738
at Container->build('view', array()) in Container.php line 633
at Container->make('view', array()) in Application.php line 674
at Application->make('Illuminate\Contracts\View\Factory', array()) in helpers.php line 63
at app('Illuminate\Contracts\View\Factory') in helpers.php line 731
at view('pages.home') in PagesController.php line 14
at PagesController->home()
at call_user_func_array(array(object(PagesController), 'home'), array()) in Controller.php line 76
at Controller->callAction('home', array()) in ControllerDispatcher.php line 146
at ControllerDispatcher->call(object(PagesController), object(Route), 'home') in ControllerDispatcher.php line 94
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 96
at ControllerDispatcher->callWithinStack(object(PagesController), object(Route), object(Request), 'home') in ControllerDispatcher.php line 54
at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\PagesController', 'home') in Route.php line 174
at Route->runController(object(Request)) in Route.php line 140
at Route->run(object(Request)) in Router.php line 703
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Router.php line 705
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 678
at Router->dispatchToRoute(object(Request)) in Router.php line 654
at Router->dispatch(object(Request)) in Kernel.php line 246
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 44
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 132
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 99
at Kernel->handle(object(Request)) in index.php line 54
在此之前,我已经安装了illuminate / html并将其删除了,因为如果有帮助的话,它会在laravel 5中掉落。
答案 0 :(得分:1)
我遇到了同样的问题,并通过将Illuminate\View\ViewServiceProvider::class
添加到app/config.php
提供程序数组中来解决此问题。
答案 1 :(得分:0)
您必须将Kernel.php更新为5.2。这就是我解决这个问题的方法。
答案 2 :(得分:0)
我得到了同样的错误。就我而言,我使用的是特定路由的自定义中间件。但我没有将中间件分配给这条路线。解决这个问题解决了我的问题。
如果您在同一条线上,请遵循以下文档: https://laravel.com/docs/5.2/middleware#registering-middleware