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
Relearning Eloquent
Search
zuckey_17
March 08, 2018
Programming
0
1.9k
Relearning Eloquent
https://laravel-meetup-tokyo.connpass.com/event/77823/
zuckey_17
March 08, 2018
Tweet
Share
More Decks by zuckey_17
See All by zuckey_17
お手並み拝見にしないオンボーディング
zuckey_17
2
2.4k
事業の試行錯誤を支える コードを捨てやすくして システムをシンプルに保つ設計と工夫
zuckey_17
10
5.3k
事業の試行錯誤を支えるピボットしやすいシステム設計と工夫 / Easy-to-pivot system design to support trial and error in business
zuckey_17
4
960
新規事業のOKRに寄り添う開発の意思決定 / Development decisions to lean on business OKRs
zuckey_17
2
600
Redash made inter-team communication active -
zuckey_17
2
5.1k
しがないラジオの作り方
zuckey_17
0
2.9k
今更聞けないReact
zuckey_17
4
2k
Other Decks in Programming
See All in Programming
そのpreloadは必要?見過ごされたpreloadが技術的負債として爆発した日
mugitti9
2
3.1k
Back to the Future: Let me tell you about the ACP protocol
terhechte
0
130
dynamic!
moro
9
6.8k
Advance Your Career with Open Source
ivargrimstad
0
380
Pull-Requestの内容を1クリックで動作確認可能にするワークフロー
natmark
2
480
NetworkXとGNNで学ぶグラフデータ分析入門〜複雑な関係性を解き明かすPythonの力〜
mhrtech
3
1.1k
技術的負債の正体を知って向き合う / Facing Technical Debt
irof
0
110
アメ車でサンノゼを走ってきたよ!
s_shimotori
0
200
Introducing ReActionView: A new ActionView-Compatible ERB Engine @ Kaigi on Rails 2025, Tokyo, Japan
marcoroth
3
950
After go func(): Goroutines Through a Beginner’s Eye
97vaibhav
0
240
クラシルを支える技術と組織
rakutek
0
190
XP, Testing and ninja testing ZOZ5
m_seki
3
360
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
514
110k
GitHub's CSS Performance
jonrohan
1032
460k
Building Better People: How to give real-time feedback that sticks.
wjessup
368
20k
Build your cross-platform service in a week with App Engine
jlugia
232
18k
Statistics for Hackers
jakevdp
799
220k
Speed Design
sergeychernyshev
32
1.1k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
890
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
189
55k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Making the Leap to Tech Lead
cromwellryan
135
9.5k
Transcript
Eloquentͷ͍ํΛߟ͑ͨ͠ 2018/03/08@Laravel Meetup Tokyo Vol.10
Introduction •zuckey •developer •ϑϩϯτΤϯυ, αʔόαΠυ •React, PHP, Laravel •twitter: @zuckey_17
•Podcastʮ͕͠ͳ͍ϥδΦʯύʔιφϦςΟʔ •https://shiganai.org
•EloquentΛ͏ཧ༝Λ͖ҧ͍͑ͯͨ •ጻչ •͓ͦΒ͘͜ͷͷଟ͘ͷਓʹͱͬͯͨΓલ
Eloquent ͱͷؔΘΓ •SQLite => MySQLͷҠߦ •ૉͷSQLΛهड़ •ORMΛͬͯDBΛԾతʹଊ͍͑ͨ ORM = ͱΓ͋͑ͣSQLΛΘͳ͍ͷ͘Β͍ʹࢥ͍ͬͯͨ
None
;ͱɺϒϩάͰॻ͍ͨίʔυ
;ͱɺϒϩάͰॻ͍ͨίʔυ $table ͍Βͳ͍ $fillable ͍Βͳ͍ ؾܰʹtoArray͠ͳ͍ େྔͷࢦఠ ʘ(^o^)ʗ
id key title description url published_at episodes id episode_id text
url episode_contents id episode_id cast_id episode_casts name twitter_screen_name image_url type casts 1 ର ଟ ଟ ର ଟ ྫ͑͜͏͍͏ςʔϒϧͰ
JSON͕΄͍͠
with ඍົͳࣝ ΫΤϦͷճര૿
ORM https://qiita.com/yk-nakamura/items/acd071f16cda844579b9
ศརͳ API Λ͏ •EagerϩʔυͰΫΤϦճΛগͳ͘ •σʔλྔ͕૿͑ΔͱtoArrayഅࣛʹͳΒͳ͍ •࿈ྻͷkeyΛมߋ͚ͨ͠Εશ෦Ҿ͍͔ͯΒ
·ͱΊ •DBͷΞΫηεΛORMܦ༝ʹ ஔ͖͑Δ͚ͩͰ͋·Γ͏·Έ͕ͳ͍ •ೖΕΔͷίετͳͷͰɺ ͍͞ͳ͍ͱٯʹෛ࠴ʹͳͬͯ͠·͏
એ •https://shiganai.org