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
How to rollback last vendor publish in laravel
提问by
Hi have messed up my project by doing vendor
publish
here is the command
last time i have executed (i'm using LARAVEL 5.4)
嗨,我最后一次执行vendor
publish
这里是搞砸了我的项目command
(我使用的是LARAVEL 5.4)
php artisan vendor:publish --tag=laravel-notifications
i want to rollback
to previous state which was there before this command
我想回到rollback
之前的状态command
what i was trying to do:i wanted to customize reset password
email
template
我想做什么:我想自定义reset password
email
模板
Problem:No longer i'm able to see my customized forgot password
template and reset password
template. but default template
is appearing for both(forgot password
and reset password
).
问题:我不再能够看到我的自定义forgot password
模板和reset password
模板。但default template
同时出现(forgot password
和reset password
)。
Question :please help to get my previous state prior to running this command
php artisan vendor:publish --tag=laravel-notifications
问题:请帮助我在运行之前获得我以前的状态command
php 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 中删除包的步骤是:
- Remove declaration from composer.json (in "require" section)
- Remove Service Provider from "app/config/app.php" (reference in "providers" array)
- Remove any Class Aliases from "app/config/app.php"
- Remove any references to the package from your code.
- Run "composer update vendor/package-name". This will remove the package folder from "vendor" folder and will rebuild composer autoloading map
- 从 composer.json 中删除声明(在“require”部分)
- 从“app/config/app.php”中删除服务提供者(“providers”数组中的引用)
- 从“app/config/app.php”中删除任何类别名
- 从您的代码中删除对包的任何引用。
- 运行“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.
这为我解决了。