How do I customize the composer package, and how do I use the custom package in the Laravel framework?
Reply content:
How do I customize the composer package, and how do I use the custom package in the Laravel framework?
This actually has several problems to solve.
Is your custom package public or private? Public can be sent directly to the packagist, private can be like @ginnerpeace said, configure a warehouse, URL to the warehouse address on the line.
Let's give an example:
{ "repositories": [ { "type": "vcs", "url": "你的包的git地址(本地和远程都行)" } ], "require": { "你的包名": "dev-master" },}
In the configuration of the composer.json
package you want, by composer update
updating, reloading composer
The autoloader, you will be able to use the required package.
Custom packages need to be created in https://packagist.org/, see https://segmentfault.com/a/1190000004294540
You can use your git address directly, so you need to configure a repository in Composer.json, which is the VCs type.
The prerequisite is that you have this GIT project in accordance with the composer specification of the JSON file, tell you this, the rest of Google, write code not the same as beggars