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

AdelMourad92's avatar

how to install packages into laravel ...offline composer

hello ...

i know that i can download packages and pull them in to laravel using composer , but i don't know how to install them offline without internet connection ??

for example i downloaded package for git-hub as (Zip) file how to add it to my current project and use it within laravel , as i mentioned (offline composer)

should i update the composer (PS-4) to autoload the package manually ??

help in that please :)

0 likes
1 reply
ohffs's avatar

You could look into the toran proxy for composer (it's written by the guy who made composer).

Other than that you can add a PSR-4 entry to your composer.json and run composer dump-autoload, eg :

{
    "autoload": {
        "psr-4": {"TheNamespace\\": "path/to/src/"}
    }
}

But if that package has dependencies then you might have to manually grab those too. It's probably easier to use the proxy or else on an internet-connected machine install everything you need then grab the vendors/ folder and copy that internally.

Please or to participate in this conversation.