无法打开流:没有这样的文件或目录(Laravel)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/53203254/
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 18:09:37  来源:igfitidea点击:

failed to open stream: No such file or directory (Laravel)

laravelcontroller

提问by Ehsan Mousavi

I renamed my UsersController.phpfile to ~UsersController.phpfor testing purposes and everything was working fine until I renamed it back to UsersController.phpand now I'm getting the below error

我将我的UsersController.php文件重命名为~UsersController.php用于测试目的,一切正常,直到我将其重命名回UsersController.php,现在我收到以下错误

include(C:\xampp\htdocs\xxx\vendor\composer/../../app/Http/Controllers/~UsersController.php): failed to open stream: No such file or directory

include(C:\xampp\htdocs\xxx\vendor\composer/../../app/Http/Controllers/~UsersController.php): failed to open stream: No such file or directory

i'm getting the above error when I want submit form to UsersControllerwhile I didn't change anything in my route file or views.

当我想提交表单时出现上述错误,UsersController而我没有更改路由文件或视图中的任何内容。

回答by Vahe Shak

Try php artisan config:cachephp artisan config:clearcomposer dump-autoload -o

尝试 php artisan config:cachephp artisan config:clearcomposer dump-autoload -o