Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Laravel_向けの_Package_の作り方.pdf
Search
jhonyspicy
November 12, 2019
Programming
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Laravel_向けの_Package_の作り方.pdf
jhonyspicy
November 12, 2019
Transcript
13 slides
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
ご静聴ありがとうございました。
Other Decks in Programming
See All in Programming
RaspberryPi 5で軽くはじめるk3sとtailscaleを用いたホームサーバー構築 (1)
nasum
0
450
あなたはMCPの機能を、まだ知らない。
4geru
1
760
読みやすい!と評判(?)の発表の準備にかける私のこだわり
shoheimitani
0
170
地方こそサーバーレス — 10年続けた、顔が見えるチームで確かな基盤を / Serverless Matters Most in Regional Areas — 10 Years of Building Reliable Foundations with Close-Knit Teams
seike460
PRO
2
530
エージェントの管理もエージェントに – herdr-core と自作バックログで作る司令塔 –
nearme_tech
PRO
2
180
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
330
Scalaの型でマルチテナントの認可を守る
nextbeatdev
0
180
protojson における文字化けの扱い
kazuki1023
0
470
SONY CISC-NEWS NWS-1750 + NWB-225 ハードウェアメンテとフレームバッファカラー対応 / KOF2026
tsutsui
0
150
テストだけで見つかる? Rubyでつくるメソッド発掘器
izawa
0
180
Crash Auto Pipelines
veronikapj
1
460
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
150
Featured
See All Featured
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
890
Ethics towards AI in product and experience design
skipperchong
2
480
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.3k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Color Theory Basics | Prateek | Gurzu
gurzu
1
530
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
680
The Curious Case for Waylosing
cassininazir
1
630
The Art of Programming - Codeland 2020
erikaheidi
57
15k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
670
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.3k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
620