Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

striker's avatar

composer update question

"require": { "laravel/framework": "5.0.", "illuminate/html": "~5.0", "proengsoft/laravel-jsvalidation": "1.0." },

The above code is from my composer.json file and i am using laravel framework 5.0 for my project.

Now i need to use dompdf in my project and for that they says that i need to add the following code in my composer.json file

"barryvdh/laravel-dompdf": "0.6.*"

and then update the composer. I am worried that when I update composer will it update my laravel version as well ? or my version will remain 5.0

0 likes
4 replies
mstnorris's avatar
Level 55

Yes it will but you can specify an exact version by removing the "~" from your Laravel version.

"require": { "laravel/framework": "5.0.", "illuminate/html": "5.0", "proengsoft/laravel-jsvalidation": "1.0." },

You should be good to go.

striker's avatar

Thanks mstnorris that was really helpful, one last thing after making changes in my composer.json file i need to update composer by using the following command :

$ composer update

right ??

mstnorris's avatar

Yep.

@striker you have two files, composer.json and composer.lock when you run composer install that looks at the composer.lock file and grabs the dependencies from there.

When you run composer update it checks if there are newer versions (where you allow, dictated by your version numbers) and updates the packages, along with updating your composer.lock file.

The reason why this is how it works, is that you can give me your project, I install it, and I will have the exact same dependencies as you.

I hope this clears it up for you.

1 like

Please or to participate in this conversation.