Command 'ui' is not defined in laravel 6.0

you can try this:

 C:\Whatever\Your_project_name>composer require laravel/ui

and

 C:\Whatever\Your_project_name>php artisan ui vue --auth

Just this two inside your project folder.I am using vue but you can try other ones too.


The same error hits me in the new version of Laravel 7.x, What I did the process is really simple: if your composer is old version and the terminal or cmd is giving you warnings to update it using some package then there are chances that the above error hits you.


Solution:

  • Step 1 : Try the following two commands in your normal terminal not of your project directory. The below command will only update the composer.

       composer self-update
    

    OR use the below command (it will update your dependencies plus your composer)

       composer update
    

    When you composer gets updated. check the composer by the below command

       composer --version
    

  • Step 2 : First go to your project root folder C:\Whatever\Your_project_name>

       composer require laravel/ui
    

    Try any of the below command according to your front end framework.

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

    At the end don't forget to run

       npm install
    

    If your User Interface is not working properly try below command.

       npm run production
    


run "composer require laravel/ui 1" instead of "composer require laravel/ui"

laravel 6 works with version 1.0, it written in docs "Want to get started fast? Install the laravel/ui (1.0)"


Did you install the dependency? To run that command you need to install an additional package:

composer require laravel/ui

After this you should be able to run one of these commands:

php artisan ui bootstrap
php artisan ui vue
php artisan ui react

In case you need the auth views, you could:

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

Don't forget to run this after:

npm install