Artisan command “make:auth” is not defined in Laravel 6

后端 未结 9 1193
长发绾君心
长发绾君心 2020-12-01 12:37

I have a problem when creating login/auth in Laravel 6. I typed \"make: auth\" in the terminal and I get an error \"Command\" make: auth \"appears not defined.\" Is there a

相关标签:
9条回答
  • 2020-12-01 12:54
    composer require laravel/ui
    php artisan ui bootstrap --auth
    
    npm install
    npm run dev
    
    0 讨论(0)
  • 2020-12-01 13:01
    • composer require laravel/ui
    • php artisan ui bootstrap --auth

    • npm install --global cross-env

    • npm install --no-bin-links
    • npm run dev
    0 讨论(0)
  • 2020-12-01 13:04

    you can copy the composer.json file and the app/Exceptions/Handler.php files from the official laravel 7 repo. link to repo: https://github.com/laravel/laravel

    Then run

    composer update
    
    composer  require laravel/ui "^2.0"
    
    php artisan ui vue --auth
    
    0 讨论(0)
  • 2020-12-01 13:06

    if you are using laravel 6, then try this command because with this command 'composer require laravel/ui' you will get only for Laravel 7.0 version and up,

            composer require laravel/ui "^1.0" --dev
    

    After Install the laravel/ui using via Composer run below command for auth scaffolding package,If Using vue then use below one,

            php artisan ui vue --auth 
    

    If using bootstrap then use below one,

            php artisan ui bootstrap --auth
    

    in a fresh Laravel application or with use of the documentation.

    0 讨论(0)
  • 2020-12-01 13:09

    Looks like L6 moves the Auth scaffolding into a separate package.

    https://laravel.com/docs/6.0/authentication

    Want to get started fast? Install the laravel/ui Composer package and run php artisan ui vue --auth in a fresh Laravel application.

    0 讨论(0)
  • 2020-12-01 13:11

    In Laravel 6.0 make:auth no longer exists. Read more here

    1 - First do this:

    composer require laravel/ui
    

    Note: Laravel UI Composer package is a new first-party package that extracts the UI portion of a Laravel project ( frontend scaffolding typically provided with previous releases of Laravel ) into a separate laravel/ui package. The separate package enables the Laravel team to update, develop and version UI scaffolding package separately from the primary framework and the main Laravel codebase.

    2 - Then do this:

    php artisan ui:auth
    

    instead of

    php artisan make:auth  ( which works for Laravel 5.8 and older versions )
    

    It will generate the auth routes, a HomeController, auth views, and a app.blade.php layout file.

    You can also generate the views only with:

    php artisan ui:auth --views
    

    The console command will prompt you to confirm overwriting auth files if you've already run the command before.

    More Options here

    // Generate basic scaffolding...
    php artisan ui vue
    php artisan ui react
    

    and also:

    // Generate login / registration scaffolding...
    php artisan ui vue --auth
    php artisan ui react --auth
    
    0 讨论(0)
提交回复
热议问题