Laravel Doesn’t Follow Semantic Versioning

While browsing repositories on GitHub I often come across Laravel packages which could simple stop working with future versions of Laravel. This can easily be fixed by being more specific.

Laravel Doesn’t Follow Semantic Versioning

Laravel doesn’t follow Semantic Versioning. Instead Laravel keeps the first number as a name, the second as major release and the third can be both feature and bug-fix. Laravel follows Romantic Versioning.




This is quite important and in my opinion all Laravel package developers should know about this.

Packages will most likely break if you allow all future versions of Laravel 5.

"illuminate/support": "~5.0"

The solution is to be more specific. Let’s say we support version 5.2 and 5.3. We can add both versions to the composer.json file.

"illuminate/support": "5.2.* || 5.3.*"

Now we know it wont break in Laravel 5.4 since we don’t allow that version.

I suggest taking a look at Graham Campbell’s packages and use them as a boilerplate for future and existing Laravel packages. Graham is one of the core contributors of Laravel. He always specifies the exact versions of Laravel in his packages.

Like this article? Reach out to me and say hi on Twitter! :wave:
All articles written with ♥ by Vincent Klaiber