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
300
ゼロから始めるフロントエンドモジュール開発についてあれこれ
ls_pr
0
170
ejsのすすめ
ls_pr
0
210
JSにおける正規表現
ls_pr
0
190
Vue.jsの機能を使って色々作ってみた
ls_pr
0
490
Other Decks in Programming
See All in Programming
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1.2k
ChromeでローカルLLM
ryu1013
0
140
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
510
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
2
390
AWSに止められる覚悟してますか?
morizo_1984
2
540
Next.js: The final boss of Web Performance
guaca
0
270
AIに “答え“を書かせるのを やめてみた
___akari11
0
120
Web Framework Benchmark Battle 2026, Any%
a_matsuda
2
2.3k
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
630
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
35
17k
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
33k
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
520
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
600
The Limits of Empathy - UXLibs8
cassininazir
2
720
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
330
Utilizing Notion as your number one productivity tool
mfonobong
4
620
Ruling the World: When Life Gets Gamed
codingconduct
0
400
GitHub's CSS Performance
jonrohan
1033
470k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
How to train your dragon (web standard)
notwaldorf
96
6.9k
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
270
Writing Fast Ruby
sferik
630
63k
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
ご清聴ありがとうございました。