How to rollback last vendor publish in laravel

10,897

Solution 1

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

  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

it will remove the package folder from "Vendor" folder

Solution 2

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

When you execute this command:

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

a folder vendor/notifications is created under the views folder.

I have delete the notifications folder, 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

Share:
10,897

Related videos on Youtube

Admin
Author by

Admin

Updated on September 15, 2022

Comments

  • Admin
    Admin over 1 year

    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)

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

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

    what i was trying to do: i wanted to customize reset password email template

    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).

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

    please help me thanks in advance!!!!

    please help me thanks in advance!!!!