http://oomusou.io/laravel/laravel-package-hello-world/
https://rivsen.github.io/post/how-to-publish-package-to-packagist-using-github-and-composer-step-by-step
一、建立資料夾
專案根目錄 / packages / github的帳號 / package名稱 / src
二、在packages 目錄下,新增composer.json
composer.json
{
"name": "wangchifu/test_page",
"description": "this is a test for composer.",
"license": "MIT",
"authors": [
{
"name": "wangchifu",
"email": "wangchifu@gmail.com"
}
],
"autoload": {
"Wangchifu\\Test_page\\": "src/"
},
"require": {}
}
三、修改本地專案下的composer.json
...
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/",
"Wangchifu\\Test_package\\": "packages/wangchifu/test_package/src/"
}
},
...
四、
沒有留言:
張貼留言