我尝试在 Laravel 5.2 中运行此命令,但它不起作用:
php artisan make:auth
并提示这些语句:
[InvalidArgumentException] Command "make:auth" is not defined Did you mean one of these? make:test make:request make:migration make:seeder make:middleware make:controller make:provider make:policy make:event make:console make:job make:lis tener make:model make:command
P粉7291982072024-01-22 14:01:32
Laravel 8 更新
laravel/ui
仍然有效,但被视为遗留。考虑使用 Laravel Breeze 或 Laravel Jetstream。
Laravel 6 更新
现在 Laravel 6 已发布,您需要安装 laravel/ui代码>.
composer require laravel/ui --dev php artisan ui vue --auth
如果您在项目中使用 React 或 Bootstrap,则可以将 vue
更改为 react
或 bootstrap
(请参阅 使用 React)。
然后您需要执行迁移并编译前端
php artisan migrate npm install && npm run dev
注意:只有当您想使用脚手架时,才可以使用默认的 User 模型和 Eloquent 身份验证驱动程序。
P粉4125335252024-01-22 12:39:20
对于 Laravel >=6
composer require laravel/ui php artisan ui vue --auth php artisan migrate
看起来您没有使用 Laravel 5.2,这些是 L5.2 中可用的 make 命令,您缺少的不仅仅是 make:auth 命令
make:auth Scaffold basic login and registration views and routes make:console Create a new Artisan command make:controller Create a new controller class make:entity Create a new entity. make:event Create a new event class make:job Create a new job class make:listener Create a new event listener class make:middleware Create a new middleware class make:migration Create a new migration file make:model Create a new Eloquent model class make:policy Create a new policy class make:presenter Create a new presenter. make:provider Create a new service provider class make:repository Create a new repository. make:request Create a new form request class make:seeder Create a new seeder class make:test Create a new test class make:transformer Create a new transformer.
确保您的composer.json 文件中有此依赖项
"laravel/framework": "5.2.*",
然后运行
composer update