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 DI・Facadeの使い方
Search
ls_pr
November 26, 2019
Programming
0
1.1k
Laravel DI・Facadeの使い方
(株)ロジカルスタジオ勉強会「ゆるっとLaravel『明日から使えるLaravelの話』」における発表資料
ls_pr
November 26, 2019
Tweet
Share
More Decks by ls_pr
See All by ls_pr
戦場で生き抜く 炎上案件の耐え方
ls_pr
0
210
自作PCのすすめ
ls_pr
0
140
ツボを押さえたWFの作り方
ls_pr
0
130
Linuxのちょこっと調べ
ls_pr
0
130
色々な色の話~今日から使える簡単配色テクニック3つ~
ls_pr
0
250
ゼロから始めるフロントエンドモジュール開発についてあれこれ
ls_pr
0
130
ejsのすすめ
ls_pr
0
170
JSにおける正規表現
ls_pr
0
140
Vue.jsの機能を使って色々作ってみた
ls_pr
0
440
Other Decks in Programming
See All in Programming
DartASTとその活用
sotaatos
2
150
GeistFabrik and AI-augmented software development
adewale
PRO
0
200
最新のDirectX12で使えるレイトレ周りの機能追加について
projectasura
0
300
OSS開発者の憂鬱
yusukebe
14
11k
jakarta-security-jjug-ccc-2025-fall
tnagao7
0
100
Module Harmony
petamoriken
2
570
チーム開発の “地ならし"
konifar
8
6.2k
無秩序からの脱却 / Emergence from chaos
nrslib
1
9.8k
React Native New Architecture 移行実践報告
taminif
1
110
dnx で実行できるコマンド、作ってみました
tomohisa
0
110
Honoを技術選定したAI要件定義プラットフォームAcsimでの意思決定
codenote
0
270
Herb to ReActionView: A New Foundation for the View Layer @ San Francisco Ruby Conference 2025
marcoroth
0
200
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
329
39k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
195
66k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
How to train your dragon (web standard)
notwaldorf
97
6.4k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Visualization
eitanlees
150
16k
A Modern Web Designer's Workflow
chriscoyier
697
190k
Side Projects
sachag
455
43k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
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
ご清聴ありがとうございました。