Php artisan make:auth command is not defined

后端 未结 8 1510
耶瑟儿~
耶瑟儿~ 2020-12-04 09:17

I am trying to run this command in laravel 5.2 but it\'s not working.

php artisan make:auth 

and prompts with these statements.

<         


        
8条回答
  •  一个人的身影
    2020-12-04 10:06

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

    A- Shorthand:

    Update Nov 18th: Taylor just released Laravel Installer 2.3.0 added a new "--auth" flag to create a new project with the authentication scaffolding installed!

    To update laravel installer read here

    It means we can do:

    laravel new project --auth
    
    cd project
    
    php artisan migrate
    
    npm install
    npm run dev
    

    Which is a shorthand of commands in the Section B. Also read more here


    B - Details:

    Follow these three steps

    Step 1 - First do this:

    laravel new project
    
    cd project
    
    composer require laravel/ui --dev
    

    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.

    Step 2 - Then do this:

    php artisan ui bootstrap --auth
    php artisan migrate
    

    or

    php artisan ui vue --auth
    php artisan migrate
    

    instead of

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

    More Options here

    php artisan ui:auth
    

    The above command will generate only 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.

    // 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
    

    To see differences read this article

    Step 3 - Then you need to do:

    npm install
    npm run dev
    

提交回复
热议问题