我收到了一个laravel错误,我无法弄清楚导致问题的代码有什么问题。
问题是:
Symfony\Component\HttpKernel\Exception\NotFoundHttpException
…/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php148
如果有人需要更多信息,请告诉我,我会提供。
编辑:这是堆栈跟踪
#0 /home/action/workspace/ssbb/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1049): Illuminate\Routing\RouteCollection->match(Object(Illuminate\Http\Request))
#1 /home/action/workspace/ssbb/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1017): Illuminate\Routing\Router->findRoute(Object(Illuminate\Http\Request))
#2 /home/action/workspace/ssbb/vendor/laravel/framework/src/Illuminate/Routing/Router.php(996): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#3 /home/action/workspace/ssbb/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(776): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#4 /home/action/workspace/ssbb/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(746): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#5 /home/action/workspace/ssbb/vendor/laravel/framework/src/Illuminate/Session/Middleware.php(72): Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request), 1, true)
#6 /home/action/workspace/ssbb/vendor/laravel/framework/src/Illuminate/Cookie/Queue.php(47): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true)
#7 /home/action/workspace/ssbb/vendor/laravel/framework/src/Illuminate/Cookie/Guard.php(51): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true)
#8 /home/action/workspace/ssbb/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true)
#9 /home/action/workspace/ssbb/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(642): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request))
#10 /home/action/workspace/ssbb/public/index.php(49): Illuminate\Foundation\Application->run()
#11 {main} [] []
答案 0 :(得分:0)
我无法在评论部分发帖,我在这里发帖
我的朋友,您需要告诉我们您要访问的网址,
至于您的路线建议应该在浏览器中localhost/laravel/-Your project name-/public/
正如@jeemusu所指出的那部分代码错误
return View::make('site::index'), it should be ('site.index'),
有一个查询约束,它接受三个参数,那里只有两个,
在这一行
with('entry', Page::where('slug', 'welcome')->first()
请告诉我们你真正想做的事情
答案 1 :(得分:0)
这是由于找不到网址所以我只是将以下代码添加到我的 /app/start/global.php 中,然后告诉我它找不到哪个网址。
App::missing(function($e)
{
$url = Request::fullUrl();
Log::warning("404 for URL: $url");
return Response::make('404 not found', 404);
});
答案 2 :(得分:0)
您可以使用以下代码检查所有内容。还从您的日志文件中过滤404(NotFoundHttpException)错误。 文件:app / start / global.php
App::error(function(Exception $exception, $errorCode)
{
$requestUrl = Request::fullUrl();
$userAgent = Request::header('user-agent');
if($errorCode != 404){
Log::error('Exception', array(
'errorCode' => $errorCode,
'requestUrl' => $requestUrl,
'userAgent' => $userAgent,
'context' => $exception,
));
}
return Response::view('error-page-path.error-404', array(), 404);
// Here "error-404" is a blade view file in "error-page-path" directory
});