写项目用到的 laravel5.4版本 用路由写数据 怎么写都报错 。解决方法如下
找到根目录下App\Http\Providers\RouteServiceProvider.php
/*
The controller namespace for the application.
应用程序的控制器命名空间。
When present, controller route declarations will automatically be prefixed with this namespace.
如果存在,控制器路由声明将自动以该命名空间作为前缀。
*/
打开该文件 找到 protected $namespace = 'App\\Http\\Controllers';
把这个注释放开就可以了
假如没有找到改代码 可以在改类里面 加上这一句。