obink's avatar
Level 1

How to Remove some packages / vendor?

What is the most effective and efficient method to undo the package I just installed and published with composer??

like composer require some-bundle/for-laravel and PHP artisan vendor:publish

it's very very uncomfortable for backing up a project every day before installing the bundle, and deleting a whole project if we found out this bundle doesn't suit me.

can we also undo this with artisan? or composer?

0 likes
5 replies
tisuchi's avatar

@obink go to the composer.json file and find the line some-bundle/for-laravel.

Then delete the line, and save the file.

Finally, run composer update in the terminal.

Way 2

You can use the terminal also for removing any package.

composer remove some-bundle/for-laravel
1 like
obink's avatar
Level 1

So, is that a two different ways thing? or is that a single way with 2 steps?

GeordieJackson's avatar

@obink You can use composer remove some-bundle/for-laravel to remove the package but you'll have to delete any published assets manually.

TIP: if you use Git, always test packages in a new branch. If you like it, you can merge it in, if not you can delete the branch - you won't then have any files left to delete manually.

obink's avatar
Level 1

how to remove the published vendor? Is it from composer.json? or maybe should I manually delete related folders?

Please or to participate in this conversation.