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.7k
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
1.9k
事業の試行錯誤を支える コードを捨てやすくして システムをシンプルに保つ設計と工夫
zuckey_17
10
4.7k
事業の試行錯誤を支えるピボットしやすいシステム設計と工夫 / Easy-to-pivot system design to support trial and error in business
zuckey_17
4
920
新規事業のOKRに寄り添う開発の意思決定 / Development decisions to lean on business OKRs
zuckey_17
1
500
Redash made inter-team communication active -
zuckey_17
2
5k
しがないラジオの作り方
zuckey_17
0
2.7k
今更聞けないReact
zuckey_17
4
1.9k
Other Decks in Programming
See All in Programming
From Translations to Multi Dimension Entities
alexanderschranz
2
130
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
140
テストケースの名前はどうつけるべきか?
orgachem
PRO
0
140
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
850
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
340
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
340
各クラウドサービスにおける.NETの対応と見解
ymd65536
0
110
Androidアプリのモジュール分割における:x:commonを考える
okuzawats
1
140
Effective Signals in Angular 19+: Rules and Helpers @ngbe2024
manfredsteyer
PRO
0
140
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
103 Early Hints
sugi_0000
1
230
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
8
4.1k
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.3k
Navigating Team Friction
lara
183
15k
Raft: Consensus for Rubyists
vanstee
137
6.7k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
98
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
It's Worth the Effort
3n
183
28k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Mobile First: as difficult as doing things right
swwweet
222
9k
The Cost Of JavaScript in 2023
addyosmani
45
7k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
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