【问题标题】:Php artisan make:auth command is not defined in Laravel 8 on ubuntu system [duplicate]Ubuntu系统上的Laravel 8中未定义Php artisan make:auth命令[重复]
【发布时间】:2021-09-15 22:50:27
【问题描述】:

我正在尝试在 laravel 8.* 中运行此命令,但它不起作用。

php artisan make:auth 

我遇到了类似的错误

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:listener
      make:model
      make:command

我也尝试过解决

composer require laravel/ui

php artisan ui vue --dev

php artisan ui vue --auth

我收到了这个错误

Your requirements could not be resolved to an installable set of packages.

【问题讨论】:

  • 安装 Laravel UI 包。 composer require laravel/ui

标签: php laravel


【解决方案1】:

先运行这个命令composer require laravel/ui再运行这个命令

php artisan ui vue --auth

请遵循这些 laravel 8 指南,您将获得解决方案

https://laravel.com/docs/8.x/authentication

这也是如何在 laravel 8 中使用身份验证的教程

https://laravelarticle.com/laravel-8-authentication-tutorial

用于身份验证的 laravel jetstream

https://dev.to/kingsconsult/laravel-8-auth-registration-and-login-32jl

【讨论】:

    【解决方案2】:
        laravel 8 you can write this command.its work for me.
        
        php artisan ui:auth
    
    =>php artisan make:auth  ( which works for Laravel 5.8 and older versions )
    

    【讨论】:

      【解决方案3】:

      如果我没记错的话,make:auth 自 Laravel 6 以来已被删除,并被提取到 Laravel ui。 关于安装这两个时的错误:

      composer require laravel/ui
      
      php artisan ui vue --auth
      

      您必须有版本冲突。尝试重新安装它:composer require laravel/ui "^3.0"

      【讨论】:

        【解决方案4】:

        所以我解决了这个问题

        随着 app/Providers/AppServiceProvider.php 的变化

        添加

        use Illuminate\Support\Facades\Schema;
        .
        .
        .
        .
        .
        .
        public function boot()
        {
           Schema::defaultstringLength(191);
        }
        

        然后使用如下命令:

        sudo apt-get install php-xml
        

        然后

        composer require laravel/ui
        
        php artisan ui:auth
        
        php artisan optimize
        
        php artisan serve
        

        它解决了我的问题 我的截图

        【讨论】:

        • 将其标记为已接受!
        【解决方案5】:

        尝试运行以下 composer 命令:

        composer update
        

        或者

        composer install
        

        然后运行ui 命令

        composer require laravel/ui
        php artisan ui vue --auth
        

        然后运行:

        npm install && npm run dev
        

        【讨论】:

          猜你喜欢
          • 2020-02-10
          • 2021-10-28
          • 2016-04-05
          • 2020-01-06
          • 2021-09-12
          • 2020-10-20
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多