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

后端 未结 9 1194
长发绾君心
长发绾君心 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 13:17

    Laravel 8.x

    This command will create a new application with all of the authentication scaffolding compiled and installed:

    laravel new kitetail --jet
    

    Laravel's laravel/jetstream package provides a quick way to scaffold all of the routes and views you need for authentication using a few simple commands:

    composer require laravel/jetstream
    
    // Install Jetstream with the Livewire stack...
    php artisan jetstream:install livewire
    
    // Install Jetstream with the Inertia stack...
    php artisan jetstream:install inertia
    

    Github : laravel /jetstream

    Official Documentation : Laravel Jetstream Documentation

    Laravel 7.x

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

    Laravel 6.x

    Laravel's laravel/ui package provides a quick way to scaffold all of the routes and views you need for authentication using a few simple commands:

    composer require laravel/ui "^1.0" --dev
    
    php artisan ui vue --auth
    

    After above commands, you'll get following output :-

    Vue scaffolding installed successfully.
    Please run "npm install && npm run dev" to compile your fresh scaffolding.
    Authentication scaffolding generated successfully.
    

    Now after running this command run this command, for Vue scaffolding

    npm install && npm run dev
    

    If you're get following error message

    npm ERR! Your cache folder contains root-owned files, due to a bug in
    npm ERR! previous versions of npm which has since been addressed.
    npm ERR! 
    npm ERR! To permanently fix this problem, please run:
    npm ERR!   sudo chown -R 1000:1000 "/home/shiv/.npm"
    npm ERR! code EACCES
    npm ERR! syscall open
    

    Then give permission user to access .npm files from system

    sudo chown -R 1000:1000 "/home/system_user_name/.npm"
    

    As i now understood clearly,running "sudo command is dangerous for npm configurations"

    Please look it this threat for more clear understanding :- npm throws error without sudo

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

    One major change introduced in Laravel 6.0 is the removal of php artisan make:auth Command

    Basically, make:auth command was used to create the authentication scaffolding. The concept has not been removed, but the way of implementation has been changed

    Update for Laravel 6: The New Way

    Authentication support is now added with the help of a package now (More details)

    The command to implement Auth is as follows:

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

    This command 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.


    NOTE: If your Login and Register page only shows plain HTML. And CSS is not loading properly then run this two command:

    npm install
    npm run dev
    
    0 讨论(0)
  • 2020-12-01 13:20

    Laravel verion 6.0

    1. composer require laravel/ui
    2. php artisan ui vue --auth

    these commands will help

    0 讨论(0)
提交回复
热议问题