waleedazam
waleedazam

Reputation: 367

How to use Laravel libraries in Laravel project without composer

I have libraries which I used to use repeatedly and have to be able to add it to Laravel project with the version I already download it before on local and may use it event with no internet connection is it possible to add it to Laravel in some way like Composer or is it possible to build my own local composer?

Upvotes: 2

Views: 1713

Answers (1)

enbermudas
enbermudas

Reputation: 1615

You can use the autoload mapping in order to adchieve that. Just create a folder with the file/files that you want to use. For example:

YourProject/app/MyClasses/

And store the files right there. Then you just have to use the composer classmap: Edit the composer.json file indicating the path to your classes:

"autoload": {
    ...
    "classmap": [
        "database/seeds",
        "database/factories"
        "app/MyClasses"
    ],
    ...
},

Run the composer dump-autoload command and you'll be ready to go.

Upvotes: 2

Related Questions