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 DI・Facadeの使い方
Search
ls_pr
November 26, 2019
Programming
1.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Laravel DI・Facadeの使い方
(株)ロジカルスタジオ勉強会「ゆるっとLaravel『明日から使えるLaravelの話』」における発表資料
ls_pr
November 26, 2019
More Decks by ls_pr
See All by ls_pr
戦場で生き抜く 炎上案件の耐え方
ls_pr
0
260
自作PCのすすめ
ls_pr
0
180
ツボを押さえたWFの作り方
ls_pr
0
180
Linuxのちょこっと調べ
ls_pr
0
170
色々な色の話~今日から使える簡単配色テクニック3つ~
ls_pr
0
290
ゼロから始めるフロントエンドモジュール開発についてあれこれ
ls_pr
0
170
ejsのすすめ
ls_pr
0
210
JSにおける正規表現
ls_pr
0
180
Vue.jsの機能を使って色々作ってみた
ls_pr
0
490
Other Decks in Programming
See All in Programming
Are APIs Still Relevant in the AI Era?
soyuka
0
310
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
530
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
6
4.6k
Intent as Code
shoppingjaws
6
1.1k
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
8.4k
Building an Out-of-Order CPU
latte72
1
800
仕様駆動開発による爆速プロダクト開発 / Bakusoku Spec Driven Development
kobakei
0
130
個人開発基盤をまるごとCloudflareに引っ越して爆速で総合的体験を向上させた話
tinykitten
0
210
市販E-Readerを乗っ取れ 〜Embedded Swiftで電子ペーパーガジェットを制御する〜
trickart
0
210
wkhtmltopdfの次どうするか問題2026
willnet
2
1.7k
AHC070解法紹介
eijirou
0
130
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
150
Featured
See All Featured
Producing Creativity
orderedlist
PRO
348
41k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The untapped power of vector embeddings
frankvandijk
2
1.9k
Crafting Experiences
bethany
1
350
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
740
Paper Plane
katiecoart
PRO
4
53k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Statistics for Hackers
jakevdp
799
230k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Transcript
www.***.com Laravel DI・Facadeの使い方
自己紹介 ・本谷 雄佑(ほんたに ゆうすけ) ・株式会社ロジカルスタジオで 主にWeb系案件のPLをやっています。
Laravelを勉強しはじめると、DIやFacadeが 頻繁に出てきます。
これらを使用せずとも問題無いのでは? と考えたこともありました。 DIやFacadeを使う理由を聞かれることもあるので、それぞ れのメリットなどを検証しました。
下記4パターンで、それぞれの差異を検証 ・newでインスタンスを取得する ・静的メソッドを使用する ・DIを使用する ・Facadeを使用する
実際のコードを見ていきます。
使用するソースコード src/app/Utilities/Env.php src/app/StaticUtilities/Env.php src/app/Facades/Env.php src/app/Providers/AppServiceProvider.php src/routes/web.php src/app/Http/Controllers/HomeController.php src/tests/Feature/HomeControllerTest.php
ご清聴ありがとうございました。