Error displayed after adding link to sidebar in laravel - laravel
I was trying to add links to sidebar in laravel but I was getting this error message:
Whoops, looks like something went wrong.
3/3 ErrorException in UrlGenerator.php line 314: Route [stock-create] not defined. (View: C:\wamp\www\pump\core\resources\views\layouts\dashboard.blade.php) (View: C:\wamp\www\pump\core\resources\views\layouts\dashboard.blade.php)
in UrlGenerator.php line 314
at CompilerEngine->handleViewException(object(ErrorException), '1') in PhpEngine.php line 44
at PhpEngine->evaluatePath('C:\wamp\www\pump\core\storage\framework\views/d039c120d96bd9a07957a999c1ef8ecb9005ec81.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'page_title' => 'Dashboard', 'site_title' => 'Petrol Pump', 'total_customer' => '22', 'total_machine' => '4', 'total_fuel' => '3', 'total_seller' => '2')) in CompilerEngine.php line 59
at CompilerEngine->get('C:\wamp\www\pump\core\resources\views/dashboard/dashboard.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'page_title' => 'Dashboard', 'site_title' => 'Petrol Pump', 'total_customer' => '22', 'total_machine' => '4', 'total_fuel' => '3', 'total_seller' => '2')) in View.php line 149
at View->getContents() in View.php line 120
at View->renderContents() in View.php line 85
at View->render() in Response.php line 53
at Response->setContent(object(View)) in Response.php line 201
at Response->__construct(object(View)) in Router.php line 1085
at Router->prepareResponse(object(Request), object(View)) in ControllerDispatcher.php line 95
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)) in Authenticate.php line 28
at Authenticate->handle(object(Request), object(Closure), 'admin')
at call_user_func_array(array(object(Authenticate), 'handle'), array(object(Request), object(Closure), 'admin')) in Pipeline.php line 136
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 ControllerDispatcher.php line 96
at ControllerDispatcher->callWithinStack(object(DashboardController), object(Route), object(Request), 'getDashboard') in ControllerDispatcher.php line 54
at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\DashboardController', 'getDashboard') in Route.php line 174
at Route->runController(object(Request)) in Route.php line 140
at Route->run(object(Request)) in Router.php line 724
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)) in VerifyCsrfToken.php line 64
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
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)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
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)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
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)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
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)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
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 Router.php line 726
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 699
at Router->dispatchToRoute(object(Request)) in Router.php line 675
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 136
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
2/3 ErrorException in UrlGenerator.php line 314: Route [stock-create] not defined. (View: C:\wamp\www\pump\core\resources\views\layouts\dashboard.blade.php)
in UrlGenerator.php line 314
at CompilerEngine->handleViewException(object(InvalidArgumentException), '2') in PhpEngine.php line 44
at PhpEngine->evaluatePath('C:\wamp\www\pump\core\storage\framework\views/0a6cb83dc869c8b58a8e29ab495dcca8c5afa94f.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'obLevel' => '1', 'page_title' => 'Dashboard', 'site_title' => 'Petrol Pump', 'total_customer' => '22', 'total_machine' => '4', 'total_fuel' => '3', 'total_seller' => '2')) in CompilerEngine.php line 59
at CompilerEngine->get('C:\wamp\www\pump\core\resources\views/layouts/dashboard.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'obLevel' => '1', 'page_title' => 'Dashboard', 'site_title' => 'Petrol Pump', 'total_customer' => '22', 'total_machine' => '4', 'total_fuel' => '3', 'total_seller' => '2')) in View.php line 149
at View->getContents() in View.php line 120
at View->renderContents() in View.php line 85
at View->render() in d039c120d96bd9a07957a999c1ef8ecb9005ec81.php line 69
at include('C:\wamp\www\pump\core\storage\framework\views\d039c120d96bd9a07957a999c1ef8ecb9005ec81.php') in PhpEngine.php line 42
at PhpEngine->evaluatePath('C:\wamp\www\pump\core\storage\framework\views/d039c120d96bd9a07957a999c1ef8ecb9005ec81.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'page_title' => 'Dashboard', 'site_title' => 'Petrol Pump', 'total_customer' => '22', 'total_machine' => '4', 'total_fuel' => '3', 'total_seller' => '2')) in CompilerEngine.php line 59
at CompilerEngine->get('C:\wamp\www\pump\core\resources\views/dashboard/dashboard.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'page_title' => 'Dashboard', 'site_title' => 'Petrol Pump', 'total_customer' => '22', 'total_machine' => '4', 'total_fuel' => '3', 'total_seller' => '2')) in View.php line 149
at View->getContents() in View.php line 120
at View->renderContents() in View.php line 85
at View->render() in Response.php line 53
at Response->setContent(object(View)) in Response.php line 201
at Response->__construct(object(View)) in Router.php line 1085
at Router->prepareResponse(object(Request), object(View)) in ControllerDispatcher.php line 95
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)) in Authenticate.php line 28
at Authenticate->handle(object(Request), object(Closure), 'admin')
at call_user_func_array(array(object(Authenticate), 'handle'), array(object(Request), object(Closure), 'admin')) in Pipeline.php line 136
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 ControllerDispatcher.php line 96
at ControllerDispatcher->callWithinStack(object(DashboardController), object(Route), object(Request), 'getDashboard') in ControllerDispatcher.php line 54
at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\DashboardController', 'getDashboard') in Route.php line 174
at Route->runController(object(Request)) in Route.php line 140
at Route->run(object(Request)) in Router.php line 724
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)) in VerifyCsrfToken.php line 64
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
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)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
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)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
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)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
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)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
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 Router.php line 726
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 699
at Router->dispatchToRoute(object(Request)) in Router.php line 675
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 136
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
1/3 InvalidArgumentException in UrlGenerator.php line 314: Route [stock-create] not defined.
in UrlGenerator.php line 314
at UrlGenerator->route('stock-create', array(), true) in helpers.php line 616
at route('stock-create') in 0a6cb83dc869c8b58a8e29ab495dcca8c5afa94f.php line 141
at include('C:\wamp\www\pump\core\storage\framework\views\0a6cb83dc869c8b58a8e29ab495dcca8c5afa94f.php') in PhpEngine.php line 42
at PhpEngine->evaluatePath('C:\wamp\www\pump\core\storage\framework\views/0a6cb83dc869c8b58a8e29ab495dcca8c5afa94f.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'obLevel' => '1', 'page_title' => 'Dashboard', 'site_title' => 'Petrol Pump', 'total_customer' => '22', 'total_machine' => '4', 'total_fuel' => '3', 'total_seller' => '2')) in CompilerEngine.php line 59
at CompilerEngine->get('C:\wamp\www\pump\core\resources\views/layouts/dashboard.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'obLevel' => '1', 'page_title' => 'Dashboard', 'site_title' => 'Petrol Pump', 'total_customer' => '22', 'total_machine' => '4', 'total_fuel' => '3', 'total_seller' => '2')) in View.php line 149
at View->getContents() in View.php line 120
at View->renderContents() in View.php line 85
at View->render() in d039c120d96bd9a07957a999c1ef8ecb9005ec81.php line 69
at include('C:\wamp\www\pump\core\storage\framework\views\d039c120d96bd9a07957a999c1ef8ecb9005ec81.php') in PhpEngine.php line 42
at PhpEngine->evaluatePath('C:\wamp\www\pump\core\storage\framework\views/d039c120d96bd9a07957a999c1ef8ecb9005ec81.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'page_title' => 'Dashboard', 'site_title' => 'Petrol Pump', 'total_customer' => '22', 'total_machine' => '4', 'total_fuel' => '3', 'total_seller' => '2')) in CompilerEngine.php line 59
at CompilerEngine->get('C:\wamp\www\pump\core\resources\views/dashboard/dashboard.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'page_title' => 'Dashboard', 'site_title' => 'Petrol Pump', 'total_customer' => '22', 'total_machine' => '4', 'total_fuel' => '3', 'total_seller' => '2')) in View.php line 149
at View->getContents() in View.php line 120
at View->renderContents() in View.php line 85
at View->render() in Response.php line 53
at Response->setContent(object(View)) in Response.php line 201
at Response->__construct(object(View)) in Router.php line 1085
at Router->prepareResponse(object(Request), object(View)) in ControllerDispatcher.php line 95
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)) in Authenticate.php line 28
at Authenticate->handle(object(Request), object(Closure), 'admin')
at call_user_func_array(array(object(Authenticate), 'handle'), array(object(Request), object(Closure), 'admin')) in Pipeline.php line 136
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 ControllerDispatcher.php line 96
at ControllerDispatcher->callWithinStack(object(DashboardController), object(Route), object(Request), 'getDashboard') in ControllerDispatcher.php line 54
at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\DashboardController', 'getDashboard') in Route.php line 174
at Route->runController(object(Request)) in Route.php line 140
at Route->run(object(Request)) in Router.php line 724
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)) in VerifyCsrfToken.php line 64
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
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)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
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)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
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)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
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)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
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 Router.php line 726
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 699
at Router->dispatchToRoute(object(Request)) in Router.php line 675
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 136
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
This is my first time of using Laravel, could someone tell me what I am doing wrong?
It's highly probable that your route is :
stock.create
and not
stock-create
Related
What might be wrong when i want to run php artisan serve
I came across this error when I tried to run php artisan serve. I downloaded this project and tried to run it encountered this error instead. Is there any solution that you guys can help me. Thanks in advance. I am using xampp as a host server for my project. ErrorException in Builder.php line 1185: count(): Parameter must be an array or an object that implements Countable in Builder.php line 1185 at HandleExceptions->handleError('2', 'count(): Parameter must be an array or an object that implements Countable', 'C:\xampp\htdocs\bootup-master\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Builder.php', '1185', array('scope' => object(Closure), 'parameters' => array(object(Builder)), 'query' => object(Builder))) at count(null) in Builder.php line 1185 at Builder->callScope(object(Closure)) in Builder.php line 1216 at Builder->applyScopes() in Builder.php line 314 at Builder->get() in HomeController.php line 30 at HomeController->index() at call_user_func_array(array(object(HomeController), 'index'), array()) in Controller.php line 80 at Controller->callAction('index', array()) in ControllerDispatcher.php line 146 at ControllerDispatcher->call(object(HomeController), object(Route), 'index') 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 102 at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 96 at ControllerDispatcher->callWithinStack(object(HomeController), object(Route), object(Request), 'index') in ControllerDispatcher.php line 54 at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\HomeController', 'index') in Route.php line 174 at Route->runController(object(Request)) in Route.php line 140 at Route->run(object(Request)) in Router.php line 724 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)) in TagstripMiddleware.php line 19 at TagstripMiddleware->handle(object(Request), object(Closure)) at call_user_func_array(array(object(TagstripMiddleware), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 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)) in VerifyCsrfToken.php line 64 at VerifyCsrfToken->handle(object(Request), object(Closure)) at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 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)) in ShareErrorsFromSession.php line 49 at ShareErrorsFromSession->handle(object(Request), object(Closure)) at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 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)) in StartSession.php line 64 at StartSession->handle(object(Request), object(Closure)) at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 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)) in AddQueuedCookiesToResponse.php line 37 at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 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)) in EncryptCookies.php line 59 at EncryptCookies->handle(object(Request), object(Closure)) at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 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 102 at Pipeline->then(object(Closure)) in Router.php line 726 at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 699 at Router->dispatchToRoute(object(Request)) in Router.php line 675 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 136 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 102 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 53 at require_once('C:\xampp\htdocs\bootup-master\public\index.php') in server.php line 21
This error is caused by the PHP version. Most probably PHP 7.2 version. See below: Document changes of PHP 7.2 To solve this issue: Donwgrade your PHP version OR Modify line 1185 of the vendor\laravel\framework\src\Illuminate\Database\Eloquent\Builder.php file $originalWhereCount = count ($ query-> wheres); to $originalWhereCount = 0; if (is_array ($ query-> wheres) || is_object ($ query-> wheres)) { $originalWhereCount = count ($ query-> wheres); }
ErrorException in Filesystem.php line 41: File does not exist at path
i have this problem after add a new controller in my laravel project 2/2 ErrorException in Filesystem.php line 41: File does not exist at path /home/xxxxxx/resources/views/layouts/controlPanel.blade.php (View: ) 1/2 FileNotFoundException in Filesystem.php line 41: File does not exist at path /home/xxxxxx/resources/views/layouts/controlPanel.blade.php The URL are OK, the view is in the right position. I have this problem for any call to this controller and only in this controller Im using Laravel 5.2 in a server with CentOS 5.8. Thanks This is the complete error: 2/2 ErrorException in Filesystem.php line 41: File does not exist at path /home/xxxxxx/resources/views/layouts/controlPanel.blade.php (View: ) in Filesystem.php line 41 at CompilerEngine->handleViewException(object(FileNotFoundException), '1') in PhpEngine.php line 44 at PhpEngine->evaluatePath('/home/xxxxxx/storage/framework/views/9bdb98dce9caefbaf93ee2cca3b1c3dc34cfcf0e.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'create' => '3', 'what' => 'nothing', 'notifications' => object(Collection))) in CompilerEngine.php line 59 at CompilerEngine->get('/home/xxxxxx/resources/views/cpanel/index.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'create' => '3', 'what' => 'nothing', 'notifications' => object(Collection))) in View.php line 149 at View->getContents() in View.php line 120 at View->renderContents() in View.php line 85 at View->render() in Response.php line 53 at Response->setContent(object(View)) in Response.php line 201 at Response->__construct(object(View)) in Router.php line 1085 at Router->prepareResponse(object(Request), object(View)) in ControllerDispatcher.php line 95 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(ControlpanelController), object(Route), object(Request), 'index') in ControllerDispatcher.php line 54 at ControllerDispatcher->dispatch(object(Route), object(Request), 'xxxxxx\Http\Controllers\ControlpanelController', 'index') in Route.php line 174 at Route->runController(object(Request)) in Route.php line 140 at Route->run(object(Request)) in Router.php line 724 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)) in VerifyCsrfToken.php line 64 at VerifyCsrfToken->handle(object(Request), object(Closure)) at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 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)) in ShareErrorsFromSession.php line 49 at ShareErrorsFromSession->handle(object(Request), object(Closure)) at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 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)) in StartSession.php line 64 at StartSession->handle(object(Request), object(Closure)) at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 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)) in AddQueuedCookiesToResponse.php line 37 at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 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)) in EncryptCookies.php line 59 at EncryptCookies->handle(object(Request), object(Closure)) at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 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 Router.php line 726 at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 699 at Router->dispatchToRoute(object(Request)) in Router.php line 675 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 136 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 1/2 FileNotFoundException in Filesystem.php line 41: File does not exist at path /home/xxxxxx/resources/views/layouts/controlPanel.blade.php in Filesystem.php line 41 at Filesystem->get('/home/xxxxxx/resources/views/layouts/controlPanel.blade.php') in BladeCompiler.php line 114 at BladeCompiler->compile('/home/xxxxxx/resources/views/layouts/controlPanel.blade.php') in CompilerEngine.php line 51 at CompilerEngine->get('/home/xxxxxx/resources/views/layouts/controlPanel.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'obLevel' => '1', 'create' => '3', 'what' => 'nothing', 'notifications' => object(Collection))) in View.php line 149 at View->getContents() in View.php line 120 at View->renderContents() in View.php line 85 at View->render() in 9bdb98dce9caefbaf93ee2cca3b1c3dc34cfcf0e.php line 195 at include('/home/xxxxxx/storage/framework/views/9bdb98dce9caefbaf93ee2cca3b1c3dc34cfcf0e.php') in PhpEngine.php line 42 at PhpEngine->evaluatePath('/home/xxxxxx/storage/framework/views/9bdb98dce9caefbaf93ee2cca3b1c3dc34cfcf0e.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'create' => '3', 'what' => 'nothing', 'notifications' => object(Collection))) in CompilerEngine.php line 59 at CompilerEngine->get('/home/xxxxxx/resources/views/cpanel/index.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'create' => '3', 'what' => 'nothing', 'notifications' => object(Collection))) in View.php line 149 at View->getContents() in View.php line 120 at View->renderContents() in View.php line 85 at View->render() in Response.php line 53 at Response->setContent(object(View)) in Response.php line 201 at Response->__construct(object(View)) in Router.php line 1085 at Router->prepareResponse(object(Request), object(View)) in ControllerDispatcher.php line 95 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(ControlpanelController), object(Route), object(Request), 'index') in ControllerDispatcher.php line 54 at ControllerDispatcher->dispatch(object(Route), object(Request), 'xxxxxx\Http\Controllers\ControlpanelController', 'index') in Route.php line 174 at Route->runController(object(Request)) in Route.php line 140 at Route->run(object(Request)) in Router.php line 724 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)) in VerifyCsrfToken.php line 64 at VerifyCsrfToken->handle(object(Request), object(Closure)) at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 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)) in ShareErrorsFromSession.php line 49 at ShareErrorsFromSession->handle(object(Request), object(Closure)) at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 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)) in StartSession.php line 64 at StartSession->handle(object(Request), object(Closure)) at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 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)) in AddQueuedCookiesToResponse.php line 37 at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 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)) in EncryptCookies.php line 59 at EncryptCookies->handle(object(Request), object(Closure)) at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 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 Router.php line 726 at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 699 at Router->dispatchToRoute(object(Request)) in Router.php line 675 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 136 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
NotFoundHttpException in Handler.php line 131: laravel
For some reason I'm getting this error NotFoundHttpException in Handler.php line 131: No query results for model [App\Modules\Menus\Models\Menu]. I shouldn't be getting this error since I'm not referencing the menu model at all in my dashboard function. I've done route:clear and route:cache without any success. Here is my CustomersController namespace App\Modules\Customers\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests; use App\Http\Controllers\Controller; use App\Modules\Menus\Models\Menu; use App\Modules\Customers\Models\Customer; use DB; use Validator; Use Mail; use Auth; class CustomersController extends Controller { public function login(Request $request) { $this->validate($request, [ 'email' => 'required|email', 'password' => 'required' ]); if(auth('customer_admin')->attempt(array('email' => $request->input('email'), 'password' => $request->input('password')))) { if(auth()->guard('customer_admin')->user()->is_activated == '0') { $this->logout(); return back()->with('error', 'Please activate your account.'); } return redirect()->route('dashboard'); }else{ return back()->with('error', 'Your email/password combination is wrong.'); } } public function dashboard() { echo "dashboard"; } } My web.php routes Route::get('/signup', [ 'uses' => 'CustomersController#signup', 'as' => 'customer.signup' ]); Route::post('/signup', [ 'uses' => 'CustomersController#postSignup', 'as' => 'post.signup' ]); Route::get('customer/activation/{token}', [ 'uses' => 'CustomersController#customerActivation', 'as' => 'activation', ]); Route::post('/login', [ 'uses' => 'CustomersController#login', 'as' => 'login' ]); // CUSTOMER LOGIN Route::get('/dashboard', [ 'uses' => 'CustomersController#dashboard', 'as' => 'dashboard' ]); Route::get('/logout', [ 'uses' => 'CustomersController#logout', 'as' => 'logout' ]); The full stack trace in Handler.php line 131 at Handler->prepareException(object(ModelNotFoundException)) in Handler.php line 109 at Handler->render(object(Request), object(ModelNotFoundException)) in Handler.php line 47 at Handler->render(object(Request), object(ModelNotFoundException)) in Pipeline.php line 82 at Pipeline->handleException(object(Request), object(ModelNotFoundException)) in Pipeline.php line 32 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41 at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65 at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49 at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64 at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37 at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59 at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102 at Pipeline->then(object(Closure)) in Router.php line 561 at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 520 at Router->dispatchToRoute(object(Request)) in Router.php line 498 at Router->dispatch(object(Request)) in Kernel.php line 174 at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 30 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in TransformsRequest.php line 30 at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in TransformsRequest.php line 30 at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ValidatePostSize.php line 27 at ValidatePostSize->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46 at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102 at Pipeline->then(object(Closure)) in Kernel.php line 149 at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116 at Kernel->handle(object(Request)) in index.php line 54 1/2 ModelNotFoundException in Builder.php line 395: No query results for model [App\Modules\Menus\Models\Menu]. in Builder.php line 395 at Builder->firstOrFail() in OpenController.php line 52 at OpenController->content('dashboard') at call_user_func_array(array(object(OpenController), 'content'), array('id' => 'dashboard')) in Controller.php line 55 at Controller->callAction('content', array('id' => 'dashboard')) in ControllerDispatcher.php line 44 at ControllerDispatcher->dispatch(object(Route), object(OpenController), 'content') in Route.php line 204 at Route->runController() in Route.php line 160 at Route->run() in Router.php line 559 at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 30 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41 at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65 at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49 at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64 at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37 at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59 at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102 at Pipeline->then(object(Closure)) in Router.php line 561 at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 520 at Router->dispatchToRoute(object(Request)) in Router.php line 498 at Router->dispatch(object(Request)) in Kernel.php line 174 at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 30 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in TransformsRequest.php line 30 at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in TransformsRequest.php line 30 at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ValidatePostSize.php line 27 at ValidatePostSize->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46 at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102 at Pipeline->then(object(Closure)) in Kernel.php line 149 at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116 at Kernel->handle(object(Request)) in index.php line 54
I see: Route::post('/login', [ 'uses' => 'CustomersController#login', 'as' => 'login' ]); How about the respective: Route::get('/login', [ 'uses' => 'CustomersController#loginPage', 'as' => 'page.login' ]); You could also redirect the user to login route when they hit dashboard route. public function dashboard() { return redirect("login"); //redirect to login page } As an aside, re-arrange your use statements to: use DB; Use Mail; use Auth; use Validator; use App\Http\Requests; use Illuminate\Http\Request; use App\Modules\Menus\Models\Menu; use App\Http\Controllers\Controller; use App\Modules\Customers\Models\Customer; This has nothing to do with the error you are having, its just a good practice. My answer to your question is in your routes file like shown above.
I assume you're using Laravel 5.2 given the routes file named web.php Your routes are loaded into RouteServiceProvider and it assumes all the controllers are located under namespace App\Http\Controllers I've noticed that your controller is under App\Modules\Customers\Http\Controllers namespace. So the correct way to define routes for it is specifying the complete namespace to it. See the example: <?php Route::get('/signup', [ 'uses' => '\App\Modules\Customers\Http\Controllers\CustomersController#signup', 'as' => 'customer.signup' ]); Another (and better) way is to define a dedicated RouteServiceProvider for each "module" of your application. Check your default provider under app/Providers/RouteServiceProvider.php file to know how it works.
Decrypt exception when calling a model with $with
I have 3 models, User, Host and URL Basically, URL has a host_id field, so that I could relate the 2 models together. Here are my models: User Model (user_urls is just a pivot table containing user_id and url_id) class User extends Authenticatable { ... irrelevant codes here... public function urls(){ return $this->belongsToMany('\App\Models\SEO\Url', 'user_urls', 'user_id', 'url_id')->withTimestamps(); } } Host model: class Host extends Model { protected $fillable = [ 'friendly_name', 'hosting_cost', 'login_url', 'username', //encrypted field 'password' //encrypted field ]; ...some irrelevant codes here... -- MUTATORS/ACCESSORS--- public function setPasswordAttribute($value){ $this->attributes['password'] = \Crypt::encrypt($value); } public function getPasswordAttribute($value){ return $this->attributes['password'] = \Crypt::decrypt($value); } ... } URL model: class Url extends Model { protected $table = 'urls'; protected $with = ['host']; public function host(){ return $this->belongsTo('\App\Models\SEO\Host', 'host_id'); } } Now, when I try to do this on a controller, return $this->user->urls(); It returns an exception in BaseEncrypter.php line 44 at BaseEncrypter->getJsonPayload('password') in Encrypter.php line 96 at Encrypter->decrypt('password') in Facade.php line 218 at Facade::__callStatic('decrypt', array('password')) in Host.php line 69 at Crypt::decrypt('password') in Host.php line 69 at Host->getPasswordAttribute('password') in Model.php line 2782 at Model->mutateAttribute('password', 'password') in Model.php line 2794 at Model->mutateAttributeForArray('password', 'password') in Model.php line 2529 at Model->attributesToArray() in Model.php line 2490 at Model->toArray() in Model.php line 2600 at Model->relationsToArray() in Model.php line 2492 at Model->toArray() in Model.php line 2480 at Model->jsonSerialize() in Collection.php line 1005 at Collection->Illuminate\Support\{closure}(object(Url)) at array_map(object(Closure), array(object(Url), object(Url), object(Url))) in Collection.php line 1013 at Collection->jsonSerialize() in Collection.php line 1024 at Collection->toJson() in Response.php line 68 at Response->morphToJson(object(Collection)) in Response.php line 46 at Response->setContent(object(Collection)) in Response.php line 197 at Response->__construct(object(Collection)) in Router.php line 1030 at Router->prepareResponse(object(Request), object(Collection)) in ControllerDispatcher.php line 95 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)) in Authenticate.php line 28 at Authenticate->handle(object(Request), object(Closure)) at call_user_func_array(array(object(Authenticate), '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 ControllerDispatcher.php line 96 at ControllerDispatcher->callWithinStack(object(UsersUrlController), object(Route), object(Request), 'api_filter') in ControllerDispatcher.php line 54 at ControllerDispatcher->dispatch(object(Route), object(Request), '\App\Http\Controllers\Users\UsersUrlController', 'api_filter') 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)) in VerifyCsrfToken.php line 64 at VerifyCsrfToken->handle(object(Request), object(Closure)) at call_user_func_array(array(object(VerifyCsrfToken), '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)) in ShareErrorsFromSession.php line 49 at ShareErrorsFromSession->handle(object(Request), object(Closure)) at call_user_func_array(array(object(ShareErrorsFromSession), '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)) in StartSession.php line 62 at StartSession->handle(object(Request), object(Closure)) at call_user_func_array(array(object(StartSession), '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)) in AddQueuedCookiesToResponse.php line 37 at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) at call_user_func_array(array(object(AddQueuedCookiesToResponse), '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)) in EncryptCookies.php line 59 at EncryptCookies->handle(object(Request), object(Closure)) at call_user_func_array(array(object(EncryptCookies), '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 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 59 I can clearly see that it is trying to decrypt a string "password", of course it will throw an error simply because it is not encrypted, but on my database it is encrypted. Why is it already encrypted before even being decrypted? Is this a possible bug? Thanks!
Maybe you can try: public function urls(){ return $this->belongsToMany('\App\Models\SEO\Url', 'user_urls', 'user_id', 'url_id'); } And call the property like this: $user=User->with('urls')->where('id',$id)->first(); $user->urls->create_at;
Guzzle6 can't resolve external websites while in local environment
I am having trouble using Guzzle with external websites when I'm in my local, development environment. I am able to use Guzzle without incident with other local sites on my machine. I am currently unable to use Guzzle with external websites in my local environment. The Code I have the following test route in my local Laravel application: Route::get('guzzle', function() { $client = new GuzzleHttp\Client(); $response = $client->get("http://www.google.com"); dd($response); }); The Response When I execute this code from my local environment I receive the following error: cURL error 6: Couldn't resolve host 'www.google.com' (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) I am able to use Guzzle with local sites. The Code Route::get('guzzle', function() { $client = new GuzzleHttp\Client(); $response = $client->get("http://test.dev"); dd($response); }); The Response Response {#180 ▼ -reasonPhrase: "OK" -statusCode: 200 -headers: array:7 [▶] -headerLines: array:7 [▶] -protocol: "1.1" -stream: Stream {#171 ▶} } ...I need help. I've looked at this for so long, I need some fresh ideas. Hopefully someone has an idea or a starting point. This is the full error message that Laravel returns. ConnectException in CurlFactory.php line 186: cURL error 6: Couldn't resolve host 'www.google.com' (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in CurlFactory.php line 186 at CurlFactory::createRejection(object(EasyHandle), array('errno' => '6', 'error' => 'Couldn't resolve host 'www.google.com'', 'url' => 'http://www.google.com/', 'content_type' => null, 'http_code' => '0', 'header_size' => '0', 'request_size' => '0', 'filetime' => '-1', 'ssl_verify_result' => '0', 'redirect_count' => '0', 'total_time' => '0', 'namelookup_time' => '0', 'connect_time' => '0', 'pretransfer_time' => '0', 'size_upload' => '0', 'size_download' => '0', 'speed_download' => '0', 'speed_upload' => '0', 'download_content_length' => '-1', 'upload_content_length' => '-1', 'starttransfer_time' => '0', 'redirect_time' => '0', 'redirect_url' => '', 'primary_ip' => '', 'certinfo' => array(), 'primary_port' => '0', 'local_ip' => '', 'local_port' => '0')) in CurlFactory.php line 150 at CurlFactory::finishError(object(CurlMultiHandler), object(EasyHandle), object(CurlFactory)) in CurlFactory.php line 103 at CurlFactory::finish(object(CurlMultiHandler), object(EasyHandle), object(CurlFactory)) in CurlMultiHandler.php line 180 at CurlMultiHandler->processMessages() in CurlMultiHandler.php line 108 at CurlMultiHandler->tick() in CurlMultiHandler.php line 123 at CurlMultiHandler->execute(true) in Promise.php line 240 at Promise->invokeWaitFn() in Promise.php line 217 at Promise->waitIfPending() in Promise.php line 261 at Promise->invokeWaitList() in Promise.php line 219 at Promise->waitIfPending() in Promise.php line 62 at Promise->wait() in Client.php line 129 at Client->request('get', 'http://www.google.com/', array()) in Client.php line 87 at Client->__call('get', array('http://www.google.com/', array(), array('proxy' => 'http://10.0.1.2'))) in routes.php line 29 at Client->get('http://www.google.com/', array(), array('proxy' => 'http://10.0.1.2')) in routes.php line 29 at RouteServiceProvider->{closure}() at call_user_func_array(object(Closure), array()) in Route.php line 155 at Route->runCallable(object(Request)) in Route.php line 130 at Route->run(object(Request)) in Router.php line 712 at Router->Illuminate\Routing\{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139 at Pipeline->Illuminate\Pipeline\{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 714 at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 679 at Router->dispatchToRoute(object(Request)) in Router.php line 639 at Router->dispatch(object(Request)) in Kernel.php line 236 at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 50 at VerifyCsrfToken->handle(object(Request), object(Closure)) at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 49 at ShareErrorsFromSession->handle(object(Request), object(Closure)) at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 62 at StartSession->handle(object(Request), object(Closure)) at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37 at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 59 at EncryptCookies->handle(object(Request), object(Closure)) at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42 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 103 at Pipeline->then(object(Closure)) in Kernel.php line 122 at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87 at Kernel->handle(object(Request)) in index.php line 54