撤消 Laravel 身份验证

Bis*_*tha 1 authentication laravel

我已经启用使用此命令Laravel认证:php artisan make:auth。但现在我想摆脱这个。有什么命令或方法可以让我做到并消除效果吗?谢谢。

Lio*_*han 5

没有可以撤消它的命令,但是如果您检查 处的命令Illuminate\Auth\Console\MakeAuthCommand,您可以看到正在更改的内容。如果要撤消它,请删除这些文件和文件夹(如果您没有创建它们)

要删除的文件:

app/Http/Controllers/HomeController.php
resources/views/auth/login.blade.php
resources/views/auth/register.blade.php
resources/views/auth/passwords/email.blade.php
resources/views/auth/passwords/reset.blade.php
resources/views/auth/passwords
resources/views/auth
resources/views/layouts/app.blade.php
resources/views/layouts
resources/views/home.blade.php
Run Code Online (Sandbox Code Playgroud)

在您的 中routes/web.php,删除这些行:

Auth::routes();
Route::get('/home', 'HomeController@index');
Run Code Online (Sandbox Code Playgroud)

编辑:Laravel 5.6

MakeAuthCommand更名为AuthMakeCommand。生成的文件没有改变。只有生成的路线略有变化:

Auth::routes();
Route::get('/home', 'HomeController@index')->name('home');
Run Code Online (Sandbox Code Playgroud)