When you build a Laravel project, there might be times when you installed a package that you actually don’t need. So, you want to uninstall it. But, how?
Run ‘composer remove package/vendor’ command in your terminal with your package and vendor name. If you’ve published your vendor, you’ll have to delete the published files manually.
For example, I want to uninstall stevebauman/location package, so I run this command and it is uninstalled.
composer remove stevebauman/location
If you’ve successfully uninstalled it, your terminal should look something like this depending on your package.
And since I published that vendor already and it copied location.php to my config folder, I deleted that file too.
Summary
That’s it! You’ve successfully installed a Laravel package.
Now that you understand more about Laravel, if you’re looking for where to host your Laravel App, I recommend Cloudways. It is compatible, fast, reliable and has a specific option for Laravel. There are also tons of resources about Laravel hosting on Cloudways. Go ahead and check it out!
If you’re looking to refresh your PHP skill, you can try Codecademy’s free PHP course. Go ahead and check out the syllabus to see if it fits you. If you’re interested, go and try it for free!
If you are interested about other topics in Laravel, you can check out my other posts :
- How to Set Up Laravel in Windows
- Laravel Project Structure
- How to Get Location in Laravel Without Google Maps API
- Is Laravel UI Deprecated?
Here are the references I used to write learn and write this post :
- Stackoverflow – How can I remove a package from Laravel using PHP Composer?
- Stackoverflow – How to rollback last vendor publish in laravel