Ad
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?
Ad
Answer
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.
Ad
source: stackoverflow.com
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?
Ad