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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
jhonyspicy
November 12, 2019
Programming
160
0
Share
Laravel_向けの_Package_の作り方.pdf
jhonyspicy
November 12, 2019
Other Decks in Programming
See All in Programming
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
210
의존성 주입과 모듈화
fornewid
0
150
感情を設計する
ichimichi
5
1.5k
AI時代のPhpStorm最新事情 #phpcon_odawara
yusuke
0
190
Vibe NLP for Applied NLP
inesmontani
PRO
0
450
PDI: Como Alavancar Sua Carreira e Seu Negócio
marcelgsantos
0
130
Liberating Ruby's Parser from Lexer Hacks
ydah
2
1.8k
tRPCの概要と少しだけパフォーマンス
misoton665
2
220
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
560
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
800
第3木曜LT会 #28
tinykitten
PRO
0
110
2026_04_15_量子計算をパズルとして解く
hideakitakechi
0
110
Featured
See All Featured
Google's AI Overviews - The New Search
badams
0
980
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Evolving SEO for Evolving Search Engines
ryanjones
0
180
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Writing Fast Ruby
sferik
630
63k
The Cult of Friendly URLs
andyhume
79
6.8k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.4k
Docker and Python
trallard
47
3.8k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
510
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
380
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
180
Prompt Engineering for Job Search
mfonobong
0
270
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
ご静聴ありがとうございました。