How to remove Auth in Laravel (PHP artisan)

With this php artisan make:auth I got all the auth stuff, but I would like to know how to remove it, or just how to reinitialize it.

I deleted all the created files, but when I re-run the command, this will not create the mysql user table again

+6
source share
5 answers

Take a look at make:auth source code of the command to see what files added or changed this command and returned the changes.

As you can see, you should remove some views and a couple of controllers.

 auth/login.blade.php auth/register.blade.php auth/passwords/email.blade.php auth/passwords/reset.blade.php layouts/app.blade.php home.blade.php 
+6
source

Check the make: auth source to understand the files or changes it created.

You will need to delete these files.

  • auth / login.blade.php
  • authorization /register.blade.php
  • authorization / passwords / email.blade.php
  • authorization / passwords / reset.blade.php
  • Layouts /app.blade.php
  • home.blade.php

As soon as this is done

Go to the /web.php routes, delete the routes created by the make: auth command. Delete these two lines and your project will work correctly.

 Auth::routes(); Route::get('/home', ' HomeController@index '); 
+3
source

You need to delete the user table from the database. Also remove the migration entry from the migration tables. and comment on the auth route code from the web.php file in the route folder. as

 Auth::routes(); 

also a middleware comment from HomeController __construct() .

 $this->middleware('auth'); 
0
source

try it

 php artisan view:clear 

this will automatically clear the compiled view.

0
source

Just run this code, it will fix your php artisan auth:clear-reset problem php artisan auth:clear-reset

-one
source

Source: https://habr.com/ru/post/1014420/


All Articles