繁体   English   中英

Php artisan make:auth 未在 Laravel 9 中定义

[英]Php artisan make:auth not defined in Laravel 9

当我尝试运行此命令时 php artisan make:auth... 出现以下错误。 有什么方法可以运行这个命令,或者这个命令的任何替代方法,我应该为此命令安装 amy 包吗?

      Command "make:auth" is not defined.
    
      Did you mean one of these?
          make:cast
          make:channel
          make:command
          make:component
          make:controller
          make:event
          make:exception
          make:factory
          make:job
          make:listener
          make:mail
          make:middleware
          make:migration
          make:model
          make:notification
          make:observer
          make:policy
          make:provider
          make:request
          make:resource
          make:rule
          make:scope
          make:seeder
          make:test

Laravel Framework 9.8.1

安装 Laravel 9 后,您需要安装 laravel/ui package 以便在 laravel 9 中生成身份验证。

 composer require laravel/ui

而不是选择其中之一

php artisan ui bootstrap --auth php artisan ui vue --auth php artisan ui react --auth

php artisan ui:auth 它对我有用。 您可以在命令下方看到它。


 Command "make:auth" is not defined. Did you mean one of these? make:cast make:channel make:command make:component make:controller make:event make:exception make:factory make:job</p> make:listener</p> make:mail</p> make:middleware make:migration make:model make:notification make:observer make:policy make:provider make:request make:resource make:rule make:seeder make:test ui:auth

如果您没有在身份验证页面中获得样式,请在 tha layouts>path 文件中使用以下链接

link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">

Omer YILMAZ 是对的,但是!

为了完成 UI 安装过程,您需要安装正确版本的 vite 和 nodejs。

因为 Laravel 9 需要 vite3+ 而 vite 需要 nodejs 14+ 版本

我的案例:我需要安装 ubuntu 20.04 上的 WSL2

  1. 安装nvm(使用不同版本的nodejs)
  2. 安装 nodejs(16 就可以)
  3. 只有到那时,我才能成功运行命令: npm install && npm run dev as needed。

我希望它有帮助

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM