laravel 如何回滚laravel中最后一个供应商发布

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/45024048/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 16:16:48  来源:igfitidea点击:

How to rollback last vendor publish in laravel

phplaravellaravel-5.4

提问by

Hi have messed up my project by doing vendorpublishhere is the commandlast time i have executed (i'm using LARAVEL 5.4)

嗨,我最后一次执行vendorpublish这里是搞砸了我的项目command(我使用的是LARAVEL 5.4

php artisan vendor:publish --tag=laravel-notifications

i want to rollbackto previous state which was there before this command

我想回到rollback之前的状态command

what i was trying to do:i wanted to customize reset passwordemailtemplate

我想做什么:我想自定义reset passwordemail模板

Problem:No longer i'm able to see my customized forgot passwordtemplate and reset passwordtemplate. but default templateis appearing for both(forgot passwordand reset password).

问题:我不再能够看到我的自定义forgot password模板和reset password模板。但default template同时出现(forgot passwordreset password)。

Question :please help to get my previous state prior to running this commandphp artisan vendor:publish --tag=laravel-notifications

问题:请帮助我在运行之前获得我以前的状态commandphp artisan vendor:publish --tag=laravel-notifications

please help me thanks in advance!!!!

请帮助我在此先感谢!!!!

please help me thanks in advance!!!!

请帮助我在此先感谢!!!!

回答by Ricard

I'm on a similar situation, but with Laravel 5.5 I think that the rollback in this situations does not exist.

我遇到了类似的情况,但是对于 Laravel 5.5,我认为在这种情况下不存在回滚。

When you execute this command:

当您执行此命令时:

php artisan vendor:publish --tag=laravel-notifications

a folder vendor/notificationsis created under the viewsfolder.

views文件夹下创建了一个文件夹供应商/通知

I have delete the notificationsfolder, and executed the command:

我已经删除了通知文件夹,并执行了命令:

php artisan view:clear

and everything is working fine.

一切正常。

I know that this is an old question, but maybe someone find this useful

我知道这是一个老问题,但也许有人觉得这很有用

回答by Mahesh Bhattarai

Got it working... The steps to remove a package from Laravel are:

成功了...从 Laravel 中删除包的步骤是:

  1. Remove declaration from composer.json (in "require" section)
  2. Remove Service Provider from "app/config/app.php" (reference in "providers" array)
  3. Remove any Class Aliases from "app/config/app.php"
  4. Remove any references to the package from your code.
  5. Run "composer update vendor/package-name". This will remove the package folder from "vendor" folder and will rebuild composer autoloading map
  1. 从 composer.json 中删除声明(在“require”部分)
  2. 从“app/config/app.php”中删除服务提供者(“providers”数组中的引用)
  3. 从“app/config/app.php”中删除任何类别名
  4. 从您的代码中删除对包的任何引用。
  5. 运行“composer update vendor/package-name”。这将从“供应商”文件夹中删除包文件夹,并将重建作曲家自动加载地图

it will remove the package folder from "Vendor" folder

它将从“供应商”文件夹中删除包文件夹

回答by Vicente de Andrade

Try this: git clean -f -d

尝试这个: git clean -f -d

-d: for directory;

-d:用于目录;

-f: for force;

-f:为力;

This solved for me.

这为我解决了。