简体   繁体   English

如何回滚php artisan的效果make:auth in laravel 5

[英]How to rollback effects of php artisan make:auth in laravel 5

I am new to laravel. 我是laravel的新手。

I was in middle of my project. 我在项目中间。 I googled for login validation in laravel 5. 我在goravel 5中搜索了登录验证。

I found this command 我找到了这个命令

php artisan make:auth

it Created several classes and also modified my welcome.blade.php 它创建了几个类,并修改了我的welcome.blade.php

there was several code in welcome.blade.php. welcome.blade.php中有几个代码。 Now How to rollback effects of this command. 现在如何回滚此命令的效果。

Please Help. 请帮忙。

Look at the make:auth command source code to understand what exactly files this command added or changed and revert changed back. 查看make:auth命令源代码,了解此命令添加或更改的确切文件以及还原后的更改。

manually you have to remove following files 手动您必须删除以下文件

  1. auth/login.blade.php AUTH / login.blade.php
  2. auth/register.blade.php AUTH / register.blade.php
  3. auth/passwords/email.blade.php AUTH /口令/ email.blade.php
  4. auth/passwords/reset.blade.php AUTH /口令/ reset.blade.php
  5. layouts/app.blade.php 布局/ app.blade.php
  6. home.blade.php home.blade.php

Go to routes/web.php , delete the created routes by the command make:auth. 转到routes/web.php ,通过命令make:auth删除创建的路由。 Remove these two lines and your project will work fine as before. 删除这两行,您的项目将像以前一样正常工作。

Auth::routes();

Route::get('/home', 'HomeController@index');

The answer is NO. 答案是不。 There is no way you can rollback make:auth command as yet in laravel.. You can remove auth manually be removing auth from app controller and and auth route. 你无法在laravel中回滚make:auth命令..你可以手动删除auth从app控制器和auth路由中删除auth。 And if you were lucky enough to have welcome file opened in some IDE then there was a chance of ctrl+z bcause IDEs keep back in memory,., but other then that there is no way retrieving backup the data. 如果你有幸在某个IDE中打开了欢迎文件,那么有可能ctrl + z因为IDE会保留在内存中,但是除此之外没有办法检索备份数据。

we can simply remove below line form wep.php routes folder. 我们可以简单地删除下面的行形式wep.php routes文件夹。

Auth::routes();
Route::get('/home', 'HomeController@index')->name('home');

you can also remove the view files: like auth folder ,app.blade.php, home.blade.php 你也可以删除视图文件:如auth文件夹,app.blade.php,home.blade.php

Delete those created classes and replace your welcome.blade.php backup. 删除这些创建的类并替换welcome.blade.php备份。 There is not 'rollback' command like in migrations : 迁移中没有“回滚”命令:

php artisan migrate:rollback php artisan migrate:rollback

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM