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
Eloquentに別れを告げるタイミングについて考えた
Search
y_ahiru
May 22, 2019
Programming
2
1.9k
Eloquentに別れを告げるタイミングについて考えた
考えました。
y_ahiru
May 22, 2019
Tweet
Share
More Decks by y_ahiru
See All by y_ahiru
フロントエンドエンジニアも知っておきたい HTTP/3 で変わること
yahiru
16
12k
ゆるふわCQRS入門
yahiru
2
530
設計におけるソリューションドメイン
yahiru
3
1.5k
PHPで始めるGitHub Actions
yahiru
1
680
5ヶ月でカバレッジを20%から90%にあげた話
yahiru
2
6.5k
入門ミューテーションテスト/ A bigginer's guide to Mutation testing
yahiru
0
1.4k
DDDについて勉強したので5分でまとめる
yahiru
0
290
Other Decks in Programming
See All in Programming
Vue.js学習の振り返り
hiro_xre
2
130
約9000個の自動テストの 時間を50分->10分に短縮 Flakyテストを1%以下に抑えた話
hatsu38
23
11k
Progressive Web Apps für Desktop und Mobile mit Angular (Hands-on)
christianliebel
PRO
0
110
現場で役立つモデリング 超入門
masuda220
PRO
12
2.9k
推し活の ハイトラフィックに立ち向かう Railsとアーキテクチャ - Kaigi on Rails 2024
falcon8823
6
2.1k
qmuntal/stateless のススメ
sgash708
0
120
CSC305 Lecture 13
javiergs
PRO
0
120
Java ジェネリクス入門 2024
nagise
0
600
offers_20241022_imakiire.pdf
imakurusu
2
360
Why Spring Matters to Jakarta EE - and Vice Versa
ivargrimstad
0
950
Synchronizationを支える技術
s_shimotori
1
150
Dev ContainersとGitHub Codespacesの素敵な関係
ymd65536
1
120
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
KATA
mclloyd
29
13k
Faster Mobile Websites
deanohume
304
30k
What's in a price? How to price your products and services
michaelherold
243
12k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
231
17k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
32
1.8k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Side Projects
sachag
452
42k
Statistics for Hackers
jakevdp
796
220k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
664
120k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2k
Transcript
Laravel Meetup Tokyo Vol.12 ٢ా͋ͻΔ (@strtyuu) &MPRVFOUʹผΕΛࠂ͛Δ λΠϛϯάʹ͍ͭͯߟ͑ͨ
ࣗݾհ ٢ా͋ͻΔ !TUSUZVV τΡΪϟολʔגࣜձࣾ 4PGUXBSF&OHJOFFS
$VSBUJPO$PNNVOJDBUJPO1MBUGPSN IUUQTUPHFUUFSDPN ·ͱΊΑ͏ɺ͋ͭ·Ζ͏
&MPRVFOU Active Record Domain Model ORM × ×
03. ɾ%#͔Βऔಘͨ͠ΛΦϒδΣΫτʹม͢Δͷ
"DUJWF3FDPSE ɾςʔϒϧɾϏϡʔͷεΩʔϚͱີ݁߹ͨ͠ϓϩύςΟ ɾϨίʔυΛΠϯελϯεԽͯ͠ৼΔ͍Λ࣋ͨͤΔ ɾυϝΠϯϞσϧͷҰछ ɾ%#ΞΫηεͷΧϓηϧԽ
%PNBJO.PEFM ɾυϝΠϯʹଘࡏ͢Δ֓೦ΛΫϥεԽͨ͠ͷ ɾυϝΠϯʹযΛͯͨɺ७ਮͳϩδοΫͷू·Γ
&MPRVFOUͷྑ͍ॴ ɾߴػೳʂ ɾָʹ։ൃ͕Ͱ͖Δʂ ɾศརͳϥΠϒϥϦͨ͘͞Μʂ
&MPRVFOUͷਏͦ͏ͳॴ ɾΫΤϦΛ࠷దԽ͍ͨ͠ͱ͖ ɾ3FQPTJUPSZύλʔϯͱͷ૬ੑ͕ඍົʁ ɾϑΝοτʹͳΓ͕ͪ ɾϞσϧ͕ςʔϒϧߏͱҰக͠ͳ͍ͱ͖
ΫΤϦͷ࠷దԽ
4&-&$5 '30.AQPTUTA 8)&3&AQPTUTAAJEA -*.*5 4&-&$5 '30.ADPNNFOUTA
8)&3& ADPNNFOUTAAQPTU@JEA "/%ADPNNFOUTAAQPTU@JEA*4/05/6--
4&-&$5 '30.AVTFSTA 8)&3&&9*454 4&-&$5 '30.AQPTUTA
8)&3& AVTFSTAAJEAAQPTUTAAVTFS@JEA
ɾ͍ΫΤϦ͕ు͔Εͯਏ͍ ಀ͛ಓ͕͋ΔͷͰɺผΕΛࠂ͛Δཧ༝ʹͳ Γʹ͍͘ʁ ɾ͕ڐ༰ൣғͰ͋Εແࢹ͢Δ͜ͱ ɾΫϦςΟΧϧͳॴ͚ͩී௨ʹ42-Λॻ͍ͯ ޡຐԽ͢ͱ͔ग़དྷΔ
Repositoryύλʔϯͱͷ ૬ੑ͕ඍົʁ
3FQPTJUPSZύλʔϯ ɾӬଓԽઌͱͷΓͱΓΛӅณ͢Δ
͑ͬ
ɾ&MPRVFOUͰ%#ΞΫηε͕ग़དྷΔ͍ͤͰɺ ɹ3FQPTJUPSZͷ֎ͰΫΤϦΛॻ͍ͯ͠·͏ &MPRVFOUʹผΕΛࠂ͛ΔΑΓɺίʔυϨ Ϗϡʔͱ͔ͰೝࣝΛ߹Θͤͨํ͕ྑͦ͞͏ ɾ&MPRVFOUͷ͍ͤͱ͍͏͔ɺ࣮ऀͷ
ϑΝοτʹͳΓ͕ͪ
ΈΜͳ͕&MPRVFOUʹΒͤͯ ͦ͏ͳ͜ͱ ɾ%#ͱͷΓͱΓ ɾଞͷ&MPRVFOUͱͷϦϨʔγϣϯ ɾυϝΠϯϞσϧͱͯ͠ͷৼΔ͍
&MPRVFOUΛϑϧ׆༻ͯ͠Δਓ ͕ͬͯͦ͏ͳ͜ͱ ɾϓϩύςΟͷόϦσʔγϣϯ ɾϓϨθϯςʔγϣϯϩδοΫ
※Laravel Boilerplate - https://github.com/rappasoft/laravel-5-boilerplate/blob/master/app/ Models/Auth/Traits/Attribute/UserAttribute.php ϓϩύςΟͷόϦσʔγϣϯ
※Laravel Boilerplate - https://github.com/rappasoft/laravel-5-boilerplate/blob/master/app/ Models/Auth/Traits/Attribute/UserAttribute.php ϓϨθϯςʔγϣϯϩδοΫ
ɾ&MPRVFOU͕ศར͗͢ΔͨΊʹɺ͋Ε͜ Ε&MPRVFOUʹ࣮͢Δ͜ͱͰ'BUʹͳͬͯ ͠·͏͜ͱ͕͋Δ &MPRVFOUʹผΕΛࠂ͛ͳͯ͘ɺ͝ͱ ʹΫϥεΛ͚Εই༊͑Δͣ ɾ&MPRVFOUͷ͍ͤͱ͍͏͔ɺΫϥεઃܭͷ
ςʔϒϧߏͱҰக͠ͳ͍ Ϟσϧ
" # $ % & ςʔϒϧA ςʔϒϧB ͤͳύλʔϯ
Model A Model B
" # $ % & ςʔϒϧA ςʔϒϧB ਏ͘ͳΔύλʔϯ
Model A × ×
ͳͥਏ͘ͳΔͷ͔ ɾ"DUJWF3FDPSEςʔϒϧɾϏϡʔͱର͕લ ఏͷσβΠϯύλʔϯ ɾKPJOલఏͷϝιου͕ଘࡏͨ͠Γ͢Δͱਏ͞ͷ ࢝·Γ ɾۀϩδοΫςʔϒϧߏͱແؔʹมԽ ͍ͯ͘͠ ɾΦϒδΣΫτϑΝʔετͳઃܭͱ૬ੑ͕ѱ͍
ɾ.Z42-ͷ7*&8*OEFYͷͱ͔͋ΔͷͰʜ
ɾ࠷େͷϝϦοτͰ͋Δ%#ͱີ݁߹ͳ෦ ɺಉ࣌ʹ࠷େͷσϝϦοτʹͳΓ͑Δ ७ਮͳυϝΠϯϞσϧ͕ඞཁʹͳͬͨΒɺ &MPRVFOUͱ͓ผΕ͢Δ߹ਤͳͷ͔͠Εͳ ͍ ٽ ɾ͜Ε&MPRVFOUͷຊ࣭తͳ෦ͱͷ૬ੑ ͷѱ͞
·ͱΊ ɾ͍͍ͩͨͷਏ͞ɺ࣮ͷͰղܾͰ͖Δͱࢥ͏ ɾ࣏҆ͷѱ͍ίʔυΛॻ͔ΕͨΒɺͪΌΜͱϨϏϡʔ Ͱ͍ͯ͜͠͏ ɾΫΤϦͷ࠷దԽ͕͖͔ͭͬͨΒ͓ผΕʹͳΔ͔͠ Εͳ͍͠ɺ·͊ͳΜͱ͔ͳΔ͔͠Εͳ͍ ɾ७ਮͳυϝΠϯϞσϧ͕ཉ͘͠ͳͬͨΒɺଟ͓ผ Ε͠ͳ͖Ό͍͚ͳ͍
ࢀߟࢿྉ ɾπΠολʔϥϯυͷΈͳ͞Μ ɹIUUQTUPHFUUFSDPNMJ ɾΤϯλʔϓϥΠζΞϓϦέʔγϣϯΞʔΩςΫνϟύλʔϯ ɹIUUQTXXXBNB[PODPKQEQ ɾ/&5ͷΤϯλʔϓϥΠζΞϓϦέʔγϣϯΞʔΩςΫνϟ ɹIUUQTXXXBNB[PODPKQEQ#;2;+/& ɾ-BSBWFM#PJMFSQMBUF
ɹIUUQTHJUIVCDPNSBQQBTPGUMBSBWFMCPJMFSQMBUF