패키지 실제로 배포해보기
- 본인 github에 올리기
@ gitignore
build
vendor
composer.lock
- packgist에 등록하기
Packagist
Define Your Package Put a file named composer.json at the root of your package's repository, containing this information: { "name": "your-vendor-name/package-name", "description": "A short description of what your package does", "require": { "php": ">=7.4"
packagist.org
2. Submit -> 아까 올린 git 저장소 url 걸기
(이미 있는 패키지명이면 못올림)
3. 전에 repositories로 직접 명시했던 경로 삭제 후 composer update 실행
4. 배포했으니 이제부터 composer require 패키지명으로 설치할 수 있음
5. README.md 작성
# Chunk Norris Jokes
Chunk Norris Jokes is joke generator.
## Installation
Require the package using composer:
```bash
composer require june/chunk-norris-jokes
```
## Usage
```php
Route::get('/', function () {
$jokes = new \June\ChunkNorrisJokes\JokeFactory(["test", "test2"]);
return view('welcome', [
"joke" => $jokes->getRandomJoke()
]);
});
```
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
## License
[MIT](./LICENSE.md/)
# Package Generator 이용가능
https://laravelpackageboilerplate.com/
Laravel Package Boilerplate
Get started with your next PHP/Laravel package in no time with this package boilerplate generator.
laravelpackageboilerplate.com
* composer로 다운받은 패키지를 직접 수정하면 배포했을 때는 수정본이 적용 안됨. 따라서 이렇게 하려면 서버에 붙어서 해당 소스부분 직접 복붙 필요!