Php artisan make: auth command not defined

I am trying to run this command in laravel 5.2 but it does not work.

php artisan make:auth 

and prompts these statements.

 [InvalidArgumentException] 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 
+12
source share
6 answers

it looks like you are not using Laravel 5.2, these are the available make commands in L5.2, and you are missing more than the make: auth command

  make:auth Scaffold basic login and registration views and routes make:console Create a new Artisan command make:controller Create a new controller class make:entity Create a new entity. make:event Create a new event class make:job Create a new job class make:listener Create a new event listener class make:middleware Create a new middleware class make:migration Create a new migration file make:model Create a new Eloquent model class make:policy Create a new policy class make:presenter Create a new presenter. make:provider Create a new service provider class make:repository Create a new repository. make:request Create a new form request class make:seeder Create a new seeder class make:test Create a new test class make:transformer Create a new transformer. 

Make sure you have this dependency in the composer.json file

  "laravel/framework": "5.2.*", 

Then run

  composer update 
+14
source

Update for Laravel 6

Now that Laravel 6 is released , you need to install laravel/ui .

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

And then you need to do the migration:

 php artisan migrate 

Source: Laravel Authentication Documentation

Want to get started quickly? Install the laravel / ui Composer package and run php artisan ui vue --auth in the new Laravel application. After transferring your database, go to your browser at http: //your-app.test/register or any other URL assigned to your application. These teams will take care of creating your entire forest authentication system!

Note: this is only if you want to use scaffolding, you can use the default user model and the Eloquent authentication driver.

+42
source

In Laravel 6.0 make: auth no longer exists. More here

1 - First do this:

 composer require laravel/ui --dev 

Note: The Laravel UI Composer package is a new third-party package that extracts part of the user interface of a Laravel project (front-end forests commonly provided in previous releases of Laravel) into a separate laravel / ui package. A separate package allows the Laravel team to update, develop and update the user interface scaffold package separately from the main Laravel platform and core code base.

2 - Then do this:

 php artisan ui:auth php artisan migrate 

instead

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

It will generate authorization routes, HomeController, authorization types and app.blade.php layout file.

You can also create views only with:

 php artisan ui:auth --views 

The console command will prompt you to confirm the rewriting of the authentication files if you have already executed the command earlier.

Additional options here

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

and:

 // Generate login / registration scaffolding... php artisan ui vue --auth php artisan ui react --auth 
+20
source

In short, all you have to do is

 composer require laravel/ui --dev 

php artisan ui vue --auth and then php artisan migrate .

Just for Laravel Authentication Overview

Laravel authentication tools come with Guard and providers , Guards determine how users are authenticated for each request, while providers determine how you get users from you persistent storage.

Database Review - By default, Laravel includes the App \ User Eloquent Model in the application directory.

Auth Namespace - App \ Http \ Controllers \ Auth

Controllers - RegisterController, LoginController, ForgotPasswordController and ResetPasswordController, all names are meaningful and easy to understand!

Routing - The Laravel / ui package provides a quick way to create all the routes and views needed for authentication with a few simple commands (as indicated at the beginning instead of make: auth ).

You can disable any newly created controller, e. gram. Register the controller and modify the route declaration, for example Auth :: routs (['register' => false]); For more information, please see the Laravel documentation .

+3
source

There should be any problems with your existing code, you should try a new new installation. https://laravel.com/docs/master/installation . You will probably understand the exact problem.

+1
source

In a Laravel 6 application, the make: auth command no longer exists.

Laravel UI is a new third-party package that extracts part of the Laravel project UI into a separate laravel / ui package. A separate package allows the Laravel team to iterate the UI package separately from the Laravel core code base.

You can install the laravel/ui package through composer:

 composer require laravel/ui 

ui:auth command ui:auth

In addition to the new user interface command, the laravel/ui package comes with another command for generating authentication forests:

 php artisan ui:auth 

If you run the ui:auth command, it will generate authentication routes, HomeController , authentication views, and the app.blade.php layout file.


If you want to create only views, enter the following command instead:

 php artisan ui:auth --views 

If you want to create authenticated forests at the same time:

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

The php artisan ui vue --auth will create all the views needed for authentication and place them in the resources/views/auth

The ui team will also create a resources/views/layouts directory containing the base layout for your application. All of these views use the Bootstrap CSS framework, but you can customize them as you wish.

Follow in more detail. Laravel News & Documentation

You just have to follow this two-step step.

 composer require laravel/ui php artisan ui:auth 
0
source

All Articles