gpt4 book ai didi

php artisan 制作:auth does not create auth controllers after deleting

转载 作者:行者123 更新时间:2023-12-04 16:45:06 28 4
gpt4 key购买 nike

所以我正在使用 Laravel 身份验证,第一次它工作正常,但删除 Auth 文件夹后,我再次运行 php artisan make:auth 但它不会创建另一个 Auth 文件夹。 View 和模型部分仍然运行良好。有办法收回吗?

最佳答案

该命令不应为您生成身份验证 Controller 。它生成适当的身份验证 View 、路由和 HomeController。引用自 docs :

php artisan make:auth

This command should be used on fresh applications and will install a layout view, registration and login views, as well as routes for all authentication end-points. A HomeController will also be generated to handle post-login requests to your application's dashboard.

如果代码在git下,您可以简单地恢复已删除的文件:

git checkout <commit> app/Http/Controllers/Auth/AuthController.php

或者您可以简单地从 Laravel 的存储库获取新副本:

wget -O app/Http/Controllers/Auth/AuthController.php https://raw.githubusercontent.com/laravel/laravel/5.1/app/Http/Controllers/Auth/AuthController.php

关于php artisan 制作:auth does not create auth controllers after deleting,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40734535/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com