Jason
Jason

Reputation: 109

ReflectionException in Container.php line 738

im pretty new to laravel 5.2, its all OK until i tried laravelcollective/html . i've installed it through composer, and suddenly i cant access my root page.

i've added these to my app/config.php in providers and aliases arrays

    Collective\Html\HtmlServiceProvider::class, 

    'Form'      => Collective\Html\FormFacade::class,
    'Html'      => Collective\Html\HtmlFacade::class,

and here's my require array in composer.json :

"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.2.*",
    "laravelcollective/html": "5.2"
},

i've read a solution that involes route:clear and cache:clear, but it doesnt works.

here's the full stacktrace :

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

before this, i've installed illuminate/html and removed it because it turned out dropped in laravel 5 if that helps.

Upvotes: 0

Views: 2515

Answers (3)

Raghav
Raghav

Reputation: 275

I was getting the same error. In my case I was using a custom middleware for the specific route. But I had not assigned the middleware to the this route. Fixing this solved the issue for me.

If you are on the same line, please follow this documentation: https://laravel.com/docs/5.2/middleware#registering-middleware

Upvotes: 0

thatguy
thatguy

Reputation: 23

I had the same issue and solved it by adding Illuminate\View\ViewServiceProvider::class into the app/config.php providers array.

Upvotes: 1

Samuel
Samuel

Reputation: 781

You have to update the Kernel.php to the 5.2 one. That is how I solved this issue.

Upvotes: 0

Related Questions