致命错误:在第 13 行的 C:\wamp\www\laravel\app\routes.php 中找不到“Route”类

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33631396/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 12:40:14  来源:igfitidea点击:

Fatal error: Class 'Route' not found in C:\wamp\www\laravel\app\routes.php on line 13

phplaravelhtml5-canvas

提问by Everson Souza de Araujo

When I add this route:

当我添加这条路线时:

Route :: get ('posting', function () {
     return "test";
});

in routes.php file, follow this error:

在 routes.php 文件中,遵循以下错误:

Fatal error: Class 'Route' not found in C: \ wamp \ www \ laravel \ app \ routes.php on line 13

致命错误:第 13 行在 C:\wamp\www\laravel\app\routes.php 中找不到类“Route”

I use laravel 4.2 to solve? Thank you

我用laravel 4.2解决?谢谢

回答by Marc Garcia

Look at your app.php, you should have this on 'aliases' array:

看看你的 app.php,你应该在 'aliases' 数组上有这个:

'Route'     => "Illuminate\Support\Facades\Route",