DEV Community

Cover image for Install your package without conflicts
Mohammad ALi Abd Alwahed
Mohammad ALi Abd Alwahed

Posted on

Install your package without conflicts

Do you know what the magic ()(star symbol) or the (^) symbol is for while installing a package?
Reading this post will help you a lot in the near future😁 .
With different versions of Laravel, we always download a package and get the lousy error that our dependencies do not match with this package. The reason is usually the mismatch between the version we are using and the latest version of this package. So what we usually do is go to the Packagist and try to find a version that matches our project's version, and then we put two dots and a number which is the version. For example:
composer require laravel/socialite:4.3
or
composer require laravel/socialite:4.^
This will bring us version 4.2 according to Packagist which has the highest number of the version we specified.
😍 The trick today is that all you have to do is type two dots and an asterisk (
) symbol and the asterisk will go and bring the version that matches your project on its own.
For example:
composer require laravel/socialite:*
Of course, the two dots and asterisk are present in any package manager for any language, whether it's npm, pip, and so on. That's it, thank you
link to the Arabic post :
https://lnkd.in/de3tQHNc

Top comments (0)