Last active
August 10, 2019 08:19
-
-
Save faizzed/a805942dd4d74b42719af1af1d67179e to your computer and use it in GitHub Desktop.
Laravel package development
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use case: | |
-------- | |
-> Adding a local package to composer. | |
-> directory structure: | |
+root | |
+packages | |
+username | |
+src | |
+PackageName | |
-Yada | |
-Yada | |
-composer.json | |
package composer.json sample: | |
---------------------------- | |
{ | |
"name": "username/packagename", | |
"description": "description", | |
"type": "library", | |
"authors": [ | |
{ | |
"name": "username", | |
"email": "email" | |
} | |
], | |
"require": {}, | |
"autoload": { | |
"psr-4": { | |
"PackageName\\": "src/Package/" | |
} | |
} | |
} | |
-- | |
app composer.json should have the local package info | |
---------------------------------------------------- | |
"require": { | |
"username/packagename": "@dev" | |
} | |
"repositories":[ | |
{ | |
"type": "path", | |
"url": "packages/username", | |
"options": { | |
"symlink": true | |
} | |
} | |
] | |
-- | |
execute the following commands and you will have your package to work with. As the package symlinked it will | |
updated no need to execute any futhur commands | |
- composer -vvv update |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment