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
さようなら Date。 ようこそTemporal! 3年間先行利用して得られた知見の共有
8beeeaaat
3
1.4k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
370
Design Foundational Data Engineering Observability
sucitw
3
190
MCPでVibe Working。そして、結局はContext Eng(略)/ Working with Vibe on MCP And Context Eng
rkaga
5
2.3k
奥深くて厄介な「改行」と仲良くなる20分
oguemon
1
520
Laravel Boost 超入門
fire_arlo
3
210
テストカバレッジ100%を10年続けて得られた学びと品質
mottyzzz
2
590
Tool Catalog Agent for Bedrock AgentCore Gateway
licux
6
2.4k
はじめてのMaterial3 Expressive
ym223
2
310
MCPとデザインシステムに立脚したデザインと実装の融合
yukukotani
4
1.4k
プロポーザル駆動学習 / Proposal-Driven Learning
mackey0225
2
1.3k
もうちょっといいRubyプロファイラを作りたい (2025)
osyoyu
1
430
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
520
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
GraphQLの誤解/rethinking-graphql
sonatard
72
11k
Rebuilding a faster, lazier Slack
samanthasiow
83
9.2k
Building Applications with DynamoDB
mza
96
6.6k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
61k
Rails Girls Zürich Keynote
gr2m
95
14k
How GitHub (no longer) Works
holman
315
140k
A Tale of Four Properties
chriscoyier
160
23k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
920
What's in a price? How to price your products and services
michaelherold
246
12k
Automating Front-end Workflow
addyosmani
1370
200k
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
ご静聴ありがとうございました。