How to customize the composer package and how to use the customized package in the laravel framework?
How to customize the composer package and how to use the customized package in the laravel framework?
There are actually several issues to solve.
Is your custom package public or private? Public ones can be sent directly to packagist, and private ones can be configured with a warehouse as @ginnerpeace said , just point the URL to the warehouse address.
Give me an example:
<code>{ "repositories": [ { "type": "vcs", "url": "你的包的git地址(本地和远程都行)" } ], "require": { "你的包名": "dev-master" }, }</code>
Configure the package you want in composer.json
, update it through composer update
, and then load the autoloader of composer
to use the required package.
Custom packages need to be created and published at https://packagist.org/, see https://segmentfault.com/a/1190000004294540
You can use your own git address directly, so you need to configure a warehouse in composer.json, the type is vcs.
The prerequisite is that your git project has a json file that conforms to composer specifications. I will tell you this. You are left to google it yourself. Don’t write code like a beggar