Skip to content

Instantly share code, notes, and snippets.

@faizzed
Last active August 10, 2019 08:19
Show Gist options
  • Save faizzed/a805942dd4d74b42719af1af1d67179e to your computer and use it in GitHub Desktop.
Save faizzed/a805942dd4d74b42719af1af1d67179e to your computer and use it in GitHub Desktop.
Laravel package development
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