Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Laravel_向けの_Package_の作り方.pdf
Search
jhonyspicy
November 12, 2019
Programming
0
160
Laravel_向けの_Package_の作り方.pdf
jhonyspicy
November 12, 2019
Tweet
Share
Other Decks in Programming
See All in Programming
いま中途半端なSwift 6対応をするより、Default ActorやApproachable Concurrencyを有効にしてからでいいんじゃない?
yimajo
2
410
Catch Up: Go Style Guide Update
andpad
0
220
Swift Concurrency - 状態監視の罠
objectiveaudio
2
520
Devvox Belgium - Agentic AI Patterns
kdubois
1
120
kiroとCodexで最高のSpec駆動開発を!!数時間で web3ネイティブなミニゲームを作ってみたよ!
mashharuki
0
170
Web Components で実現する Hotwire とフロントエンドフレームワークの橋渡し / Bridging with Web Components
da1chi
3
2.4k
なぜGoのジェネリクスはこの形なのか? Featherweight Goが明かす設計の核心
ryotaros
7
1.1k
uniqueパッケージの内部実装を支えるweak pointerの話
magavel
0
1k
TFLintカスタムプラグインで始める Terraformコード品質管理
bells17
2
160
PHPに関数型の魂を宿す〜PHP 8.5 で実現する堅牢なコードとは〜 #phpcon_hiroshima / phpcon-hiroshima-2025
shogogg
1
210
CI_CD「健康診断」のススメ。現場でのボトルネック特定から、健康診断を通じた組織的な改善手法
teamlab
PRO
0
210
monorepo の Go テストをはやくした〜い!~最小の依存解決への道のり~ / faster-testing-of-monorepos
convto
2
490
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Agile that works and the tools we love
rasmusluckow
331
21k
Rails Girls Zürich Keynote
gr2m
95
14k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Automating Front-end Workflow
addyosmani
1371
200k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.1k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Git: the NoSQL Database
bkeepers
PRO
431
66k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Building Better People: How to give real-time feedback that sticks.
wjessup
369
20k
Transcript
Laravel 向けの Packageの作り方 初LTです((((;゚Д゚))))ガクガクブルブル
自己紹介 • 高良 和真 • 琉球インタラクティブ株式会社 • Laravel + Lighthouse(GraphQL)
• @jhonyspicy • ビリヤード・DIY・ステンレス削り
今回のサンプルはこちら https://github.com/jhonyspicy/laravel-example-package
1. GitHubにリポジトリを追加 2. orchestral/testbench パッケージを追加 3. テストを書きつつ開発 4. Packagistで公開 大まかな流れ
1. git clone 2. composer init 3. composer require --dev
orchestra/testbench 4. 下記を作成 • /src • /tests/Feature • /tests/Unit • /phpunit.xml
composer.json に autoload の設定を追記 "autoload": { "psr-4": { "jhonyspicy\\LaravelExamplePackage\\": "src/"
} }, "autoload-dev": { "psr-4": { "jhonyspicy\\LaravelExamplePackage\\Tests\\": "tests" } }
この時点で簡単なテストが動きます。 class ExampleTest extends TestCase { /** * A basic
test example. * * @return void */ public function testBasicTest() { $this->assertTrue(true); } }
DBを使いたい時 • SQLiteのインメモリDBが使えます。 • migrationを使えます。 • factoryも使えます。
None
Versionの上げ方 Tagをつけてプッシュ 例 • 1.0.0 • v1.0.0 • 1.10.5-RC1 •
v4.4.4beta2 • v2.0.0-alpha • v2.0.4-p1
Providerを自動で読み込む composer.jsonに追記 "extra": { "laravel": { "providers": [ "jhonyspicy\\LaravelExamplePackage\\Provider" ]
} }
不要なファイル除外する .gitattributes 追加 /tests export-ignore .gitattributes export-ignore .gitignore export-ignore phpunit.xml
export-ignore
ご静聴ありがとうございました。