1

In laravel compposer i have this

"require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.1.*",
        "laravelcollective/html": "~5.0"
    },

then I found in the doucumentation laravelcollective/htmlto add this in composer

"laravelcollective/html": "5.1.*"

what is the difference if we use ~ than * ? or how do I read this "laravelcollective/html": "~5.0" and this "laravelcollective/html": "5.1.*"

Limon Monte
  • 52,539
  • 45
  • 182
  • 213
jemz
  • 4,987
  • 18
  • 62
  • 102
  • possible duplicate of [What does the tilde (~) mean in my composer.json file?](http://stackoverflow.com/questions/18979729/what-does-the-tilde-mean-in-my-composer-json-file) – samlev Sep 21 '15 at 17:18

1 Answers1

7

Taking a look at the composer documentation for ~:

... using ~ specifies a minimum version, but allows the last digit specified to go up.

So ~5.0 would match 5.0, 5.1, 5.2, (including sub-versions like 5.0.3) etc. where as 5.1.* would match only versions that start with 5.1, but without caring about the third version identifier.

With ~, you could specify something like: ~5.1.3 and you would be able to get versions 5.1.3, 5.1.4, etc., but not versions 5.1.2 or 5.2.0.

samlev
  • 5,852
  • 1
  • 26
  • 38