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.7k
事業の試行錯誤を支える コードを捨てやすくして システムをシンプルに保つ設計と工夫
zuckey_17
10
4.6k
事業の試行錯誤を支えるピボットしやすいシステム設計と工夫 / Easy-to-pivot system design to support trial and error in business
zuckey_17
4
910
新規事業のOKRに寄り添う開発の意思決定 / Development decisions to lean on business OKRs
zuckey_17
1
470
Redash made inter-team communication active -
zuckey_17
2
4.9k
しがないラジオの作り方
zuckey_17
0
2.7k
今更聞けないReact
zuckey_17
4
1.9k
Other Decks in Programming
See All in Programming
Arm移行タイムアタック
qnighy
0
320
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
190
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
190
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
430
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
470
Quine, Polyglot, 良いコード
qnighy
4
640
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.2k
Featured
See All Featured
Designing the Hi-DPI Web
ddemaree
280
34k
Practical Orchestrator
shlominoach
186
10k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Automating Front-end Workflow
addyosmani
1366
200k
Speed Design
sergeychernyshev
25
620
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Fireside Chat
paigeccino
34
3k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Bash Introduction
62gerente
608
210k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
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