Laravel 8-错误类别';App\Student';在StudentController.php中找不到
希望有人能在这个错误上启发我。拉威尔8。我正在从以下url复制一个简单的博客: 看起来有时候你会做这些教程,但是Laravel8有些不同。我错过了什么?如有任何建议,将不胜感激 获取错误当转到/students&a/students/创建URL时,我会收到不同的错误 /学生(索引)错误- 错误 未找到类“App\Student” 它也不喜欢创建路由,这很奇怪,因为我在StudentController中有store方法 /学生/创建(创建)错误- 动作StudentController@store没有定义。(视图:C:\xampp\htdocs\laravel\lara-blog2\blog\resources\views\students\create.blade.php)Laravel 8-错误类别';App\Student';在StudentController.php中找不到,php,laravel,controller,laravel-8,Php,Laravel,Controller,Laravel 8,希望有人能在这个错误上启发我。拉威尔8。我正在从以下url复制一个简单的博客: 看起来有时候你会做这些教程,但是Laravel8有些不同。我错过了什么?如有任何建议,将不胜感激 获取错误当转到/students&a/students/创建URL时,我会收到不同的错误 /学生(索引)错误- 错误 未找到类“App\Student” 它也不喜欢创建路由,这很奇怪,因为我在StudentController中有store方法 /学生/创建(创建)错误- 动作StudentController@stor
当您使用Laravel 8时,所有型号现在都与以前的版本一样位于App
目录中的App\models
目录中,因此您需要更新导入语句以
use App\Models\Student;
阅读更多关于《Laravel发行说明》中的型号
新目录的信息在Laravel 8中,所有型号现在都位于App/Models中,因此请使用
use App\Models\Student;
在laravel 8上,它将是use-App\Models\Student代码>你能分享更多细节吗?您是否在任何地方定义了该类App\Student
?
use App\Models\Student;