Slide 1

Slide 1 text

鈴木孝之 LaravelͱNuxt.jsͰอकੑΛ ߴΊΔߏ੒Λߟ͑ͯΈͨ

Slide 2

Slide 2 text

"HFOEB ࣗݾ঺հ -BSBWFM7VFKTͰͷ41"։ൃͷ՝୊ײ ߟ͑ͯΈͨϓϩδΣΫτߏ੒ 'BU$POUSPMMFSΛ๷͙

Slide 3

Slide 3 text

Copyright Re:Build.inc All Rights Reserved. ର৅ऀʹ͍ͭͯ 0 -BSBWFMͱ7VFKT/VYUKTΛ࢖͍ͬͯΔ σΟϨΫτϦߏ੒ͳͲΛ໛ࡧத ՄಡੑɾอकੑΛ্͍͛ͨ ॳڃऀʙதڃऀ޲͚

Slide 4

Slide 4 text

Copyright Re:Build.inc All Rights Reserved. ࿩͢͜ͱɾ࿩͞ͳ͍͜ͱ 0 -BSBWFMத৺ͷઃܭʹ͍ͭͯ 7VFKT/VYUKTͷઃܭʹ͍ͭͯ গ͠ σΟϨΫτϦߏ੒ͳͲ ࿩͢͜ͱ ࿩͞ͳ͍͜ͱ ΠϯϑϥपΓͷৄ͍͠࿩ ϚωδϝϯτɾνʔϜମ੍ ͳͲ

Slide 5

Slide 5 text

ࣗݾ঺հɾձࣾ঺հ

Slide 6

Slide 6 text

Copyright Re:Build.inc All Rights Reserved. ࣗݾ঺հ 1 ◆໊લ ླ໦ ޹೭(Suzuki Takayuki) ※ಉ੏ಉ໊ଟͯ͘ࠔͬͯ·͢ɻɻɻ ◆ࣗݾ঺հ ɾ1990೥ੜ·Εɻ ɾΤϯδχΞˠϑϦʔϥϯεˠԭೄͰىۀ ɾPHPΧϯϑΝϨϯεԭೄ࣮ߦҕһ௕ɺ ϑϩϯτΤϯυΧϯϑΝϨϯεԭೄ࣮ߦҕһ௕ ◆झຯ ίεϓϨɺԻָϥΠϒɺϚϥιϯେձʹग़Δɺ໺ٿ؍ઓ BDD(Ϗʔνۦಈ։ൃ)

Slide 7

Slide 7 text

Copyright Re:Build.inc All Rights Reserved. ࣗݾ঺հ 1

Slide 8

Slide 8 text

Copyright Re:Build.inc All Rights Reserved. ࣗݾ঺հ 1

Slide 9

Slide 9 text

Copyright Re:Build.inc All Rights Reserved. ധ̏೔Ͱ։࠵ʂࣾ֎ͷํ΋ ߹ಉͰ։ൃͯ͠·͢ʂ ϦϏϧυԭೄ։ൃ߹॓ 1

Slide 10

Slide 10 text

Copyright Re:Build.inc All Rights Reserved. ϦϏϧυԭೄ։ൃ߹॓ 1

Slide 11

Slide 11 text

Copyright Re:Build.inc All Rights Reserved. ࣗݾ঺հ 1

Slide 12

Slide 12 text

Copyright Re:Build.inc All Rights Reserved. ձࣾ঺հ 1 ◆ձ໊ࣾ גࣜձࣾRe:Build ◆ॅॴ ԭೄݝಹ೼ࢢٱໜ஍2-2-2 λΠϜεϏϧ ◆ࣄۀ಺༰ ɾࣗࣾWEBαʔϏεͷاըɾ։ൃɻ ɾडୗ։ൃ ɾϓϩάϥϛϯάεΫʔϧ ◆ࣾһ 11໊ ΤϯδχΞืूͯ͠·͢ʂʂʂ

Slide 13

Slide 13 text

Copyright Re:Build.inc All Rights Reserved. 1 3 ɾαʔϏε໊ Tadoru
 https://tadoru.work/
 
 ɾγεςϜ֓ཁ ΤϯδχΞಛԽܕͷ ϦϑΝϥϧ Ϋϥ΢υιʔγϯά 1 ձࣾ঺հ

Slide 14

Slide 14 text

Copyright Re:Build.inc All Rights Reserved. 1 4 ɾαʔϏε໊ ROLEMO
 https://rolemo.net/
 ɾγεςϜ֓ཁ ༷ʑͳΩϟϦΞͷΤϯδχΞʹ ΩϟϦΞ૬ஊͰ͖ΔαʔϏε 1 ձࣾ঺հ

Slide 15

Slide 15 text

Copyright Re:Build.inc All Rights Reserved. อकੑͱ͸ - อक࡞ۀΛ࣮ࢪ͢Δ͜ͱͰɺػೳ΍ঢ়ଶ͕ҡ࣋͞ΕΔੑ࣭ɻ ·ͨɺͦͷ༰қ͞ɻ - ιϑτ΢ΣΞͷ৔߹ʹ͸ɺޡΓ΍ෆ۩߹ͷൃݟɾमਖ਼ͷ͠΍ ͢͞΍ɺࣄલʹ༧ఆ͞Ε͍ͯͳ͔ͬͨ࢓༷มߋ΍ػೳ௥Ճͳ Ͳͷߦ͍΍͢͞ɺιʔείʔυͷಡΈ΍͢͞ͱ͍ͬͨ఺͕த ৺ͱͳΔɻ https://e-words.jp/w/%E4%BF%9D%E5%AE%88%E6%80%A7.html

Slide 16

Slide 16 text

Copyright Re:Build.inc All Rights Reserved. αϚϦ - ܕ΍ϦΫΤετɾϨεϙϯεΛՄࢹԽͯ͠ɺΤϥʔͷ੾Γ෼͚Λ͠΍͘͢͢ Δɻ
 - LintΛ͔ͬ͠Γಋೖ͢Δ͜ͱͰɺେਓ਺΍ΦϑγϣΞ։ൃͳͲͷϓϩδΣΫτ Ͱ΋ॻ͖ํΛ౷Ұ͢Δɻ
 - ֤૚ͷ໾ׂΛϋοΩϦͤͯ͞ɺίʔυΛಡΈ΍͘͢͢ΔɻFat Controller͸ආ͚ Δɻ อकੑΛߴΊΔʹ͸ʁ

Slide 17

Slide 17 text

Copyright Re:Build.inc All Rights Reserved. ࿩্͢Ͱͷલఏ - ։ൃن໛͸த͘Β͍͕ଟ͍ɻ - ̏ʙ̒ਓͰ൒೥ʙ1೥։ൃϓϩδΣΫτ͕ଟ͍ɻ - େن໛ϓϩδΣΫτ͸গͳ͍ɻ ฐࣾʹ͓͚Δ։ൃϓϩδΣΫτͷಛ௃

Slide 18

Slide 18 text

-BSBWFM7VFKTͰͷ41"։ൃͷ՝୊ײ

Slide 19

Slide 19 text

Copyright Re:Build.inc All Rights Reserved. 2 SPA։ൃͷ՝୊ ϑϩϯτΤϯυͱόοΫ ΤϯυͰܕͷ੔߹ੑΛ୲ อ͍ͨ͠ SPAͷσΟϨΫτϦ ߏ੒ͬͯϕετϓϥΫςΟ εΛݟ͚ͭΔͷ͕೉͍͠ Laravel/Vue.js͸ࣗ༝ʹॻ͚Δ ෼ɺͪΌΜͱϧʔϧΛܾΊͳ͍ͱ ͙ͪΌ͙ͪΌʹͳΓ͕ͪ

Slide 20

Slide 20 text

Copyright Re:Build.inc All Rights Reserved. ෭ۀɺϑϦʔϥϯεɺΦϑγϣΞɺ৽ਓͳͲ ͍ΖΜͳਓ͕ϓϩδΣΫτʹࢀը͍ͯ͠Δ৔߹ɺ ϧʔϧ͕͔ͬ͠Γ͍ͯ͠ͳ͍ͱɺ ίʔυ͕εύήςΟʹͳΓ͕ͪʂʂʂ 2 ෳ਺ਓ։ൃϓϩδΣΫτͷ՝୊

Slide 21

Slide 21 text

ߟ͑ͯΈͨϓϩδΣΫτߏ੒

Slide 22

Slide 22 text

2 2 બఆٕͨ͠ज़ ■ٕज़ཁ݅ ɾαʔόαΠυ PHP(Laravel) ɾϑϩϯτΤϯυ Vue.js,Nuxt.js TypeScript ɾςετ PHPUnit ɾ੩తղੳ ESlint,Stylelint PHPStan,phpcs,phpmd ɾΠϯϑϥ AWS(EC2,S3,RDS(mariadb)) ɾ։ൃ؀ڥ php7,nginx,mariadb,docker,webpack ɾͦͷଞ gitlab,gitlabCI(ࣗಈσϓϩΠͳͲ)

Slide 23

Slide 23 text

ϑϩϯτΤϯυ αʔόαΠυ શମߏ੒(ࣗࣾαʔϏε OREIO) Gitlab CI ςετɾLintͳͲ ςετɾLintͳͲ ֤lint

Slide 24

Slide 24 text

(1)PUSH (2)GitlabCI࣮ߦ (3)ίϯςφىಈ Gitlab (6)Envoy࣮ߦ ςετ࣮ߦ ίϯςφ σϓϩΠ࣮ߦ ίϯςφ (5)ίϯςφىಈ (4)UnitTest࣮ߦ (7)Pull εςʔδϯά؀ڥ ϦϙδτϦ Gitlab CI

Slide 25

Slide 25 text

ϑϩϯτΤϯυ શମߏ੒(ৄࡉ) αʔόαΠυ(API) ϒϥ΢β͔ΒΞΫηε Component HTML CSS JS Pages request.ts response.ts Types Resouce.php APIϦΫΤετ APIϨεϙϯε ϦΫΤετɾϨεϙϯεͷ ܕΛఆٛ Request.php router controller Model Database router όϦσʔγϣϯ Ϩεϙϯε஋Λ ఆٛ Service αʔυύʔςΟ Libs/api/index.ts Enum ਵ࣌࢖༻

Slide 26

Slide 26 text

Laravelͷߏ੒ʹ͍ͭͯ

Slide 27

Slide 27 text

Laravelߏ੒(ৄࡉ) αʔόαΠυ ϒϥ΢β͔Β ΞΫηε HTML CSS JS View Resouce.php APIϦΫΤετ APIϨεϙϯε Request.php router controller Model Database όϦσʔγϣϯ Ϩεϙϯε஋Λ ఆٛ Service αʔυύʔςΟ Enum ਵ࣌࢖༻

Slide 28

Slide 28 text

αʔόαΠυ Resouce.php APIϦΫΤετ APIϨεϙϯε Request.php router controller Model Database όϦσʔγϣϯ Ϩεϙϯε஋Λ ఆٛ Service αʔυύʔςΟ ControllerͰग़͖ͯ ͨϩδοΫΛmodel ʹدͤΔ ϒϥ΢β͔Β ΞΫηε HTML CSS JS View Laravelߏ੒(ৄࡉ) Enum ਵ࣌࢖༻

Slide 29

Slide 29 text

αʔόαΠυ Resouce.php APIϦΫΤετ APIϨεϙϯε Request.php router controller Model Database όϦσʔγϣϯ Ϩεϙϯε஋Λ ఆٛ Service αʔυύʔςΟ ֎෦αʔϏεΛୟ͘ Α͏ͳॲཧ͸Service ʹॻ͘ ϒϥ΢β͔Β ΞΫηε HTML CSS JS View Laravelߏ੒(ৄࡉ) Enum ਵ࣌࢖༻

Slide 30

Slide 30 text

αʔόαΠυ Resouce.php APIϦΫΤετ APIϨεϙϯε Request.php router controller Model Database όϦσʔγϣϯ Ϩεϙϯε஋Λ ఆٛ Service αʔυύʔςΟ ϒϥ΢β͔Β ΞΫηε HTML CSS JS View Laravelߏ੒(ৄࡉ) Enum ਵ࣌࢖༻ DBͰఆٛ͢Δ΄ͲͰ ͸ͳ͍Α͏ͳఆ਺ܥ ͸Enumʹॻ͘

Slide 31

Slide 31 text

αʔόαΠυ Resouce.php APIϦΫΤετ APIϨεϙϯε Request.php router controller Model Database όϦσʔγϣϯ Ϩεϙϯε஋Λ ఆٛ Service αʔυύʔςΟ Enum ਵ࣌࢖༻ ό Ϧ σ ʔ γ ϣ ϯ ͸ RequestΫϥεʹॻ͘ ϒϥ΢β͔Β ΞΫηε HTML CSS JS View Laravelߏ੒(ৄࡉ)

Slide 32

Slide 32 text

αʔόαΠυ Resouce.php APIϦΫΤετ APIϨεϙϯε Request.php router controller Model όϦσʔγϣϯ Ϩεϙϯε஋Λ ఆٛ Service αʔυύʔςΟ Repository Logic Ϗδωεɾ ϩδοΫ σʔλɾ ΞΫηε Database ϒϥ΢β͔Β ΞΫηε HTML CSS JS View Laravelߏ੒(΋ͬͱɺେن໛ʹͳ͖ͬͯͨΒ) Enum ਵ࣌࢖༻

Slide 33

Slide 33 text

LaravelͷσΟϨΫτϦߏ੒

Slide 34

Slide 34 text

LaravelͷσΟϨΫτϦߏ੒(֤σΟϨΫτϦͷղઆ) ※ؾʹͳΔਓ͸ޙͰಡΜͰ͓͍͍ͯͩ͘͞ɻ

Slide 35

Slide 35 text

LaravelͷσΟϨΫτϦߏ੒(֤σΟϨΫτϦͷղઆ) ※ؾʹͳΔਓ͸ޙͰಡΜͰ͓͍͍ͯͩ͘͞ɻ

Slide 36

Slide 36 text

ϦϙδτϦύλʔϯͬͯͲ͏ͳͷʁ ϦϙδτϦύλʔϯͱ͸(Ҿ༻) υϝΠϯۦಈܕઃܭͷҰͭͱͯ͠ಋೖ͞Εͨ ΋ͷͰɺσʔλιʔε΁ͷΞΫηεͷந৅Խ Λఏڙ͢Δ΋ͷͰ͢ɻ ͦΕͧΕҟͳΔੑ࣭Λ࣋ͭσʔλιʔεʹର ͯ͠ڞ௨ͷΠϯλʔϑΣΠεΛఆٛͦ͠ΕΛ ϦϙδτϦͱ࣮ͯ͠૷͢ΔࣄͰɺ Ϗδωεϩ δοΫ͔ΒσʔλΞΫηεΛ෼཭ʢૄ݁߹ʣ ͤ͞ɺػೳͱͯ͠ͷ֦ுੑɾอकੑΛ޲্͞ ͤΔࣄ͕Ͱ͖·͢ɻ https://deha.co.jp/magazine/introducing-laravel-repository/

Slide 37

Slide 37 text

ϦϙδτϦύλʔϯͷ࢖͍ॴ User UserRepositoryInterface UserMysqlRepository UserSqliteRepository ɾσʔλιʔε΁ͷΞΫηεɾૢ࡞ʹؔͯ͠ʮSELECTʯʮINSERTʯʮUPDATEʯʮDELETEʯͳͲ͕͋Γ· ͕͢ɺͦΕΒͷૢ࡞͸ྫ͑͹RDBMSͱNoSQLͰจ๏ͷҧ͍͕͋ΔͷͰɺ͜ΕΒͷૢ࡞ͷҝʹࢲୡ͕ॻ͘ίʔ υʹ͸ͦΕͧΕҧ͍͕͋Γ·͢ɻ ͜ΕΒΛڞ௨ͷΠϯλʔϑΣΠεΛ࣋ͨͤΔࣄͰɺϏδωεଆͰ͸Ͳͷσʔ λιʔε͔ΛҙࣝͤͣʹσʔλଆΛѻ͏ࣄ͕Ͱ͖ΔΑ͏ʹͳΔɻ https://www.ritolab.com/entry/165

Slide 38

Slide 38 text

ϦϙδτϦύλʔϯͷ࢖͍ॴ̎ Report ϓϩδΣΫτڞ௨Ͱ࢖͏Α͏ͳܭࢉॲཧΛ·ͱΊͯɺఆ͓ٛͯ͘͠ɻ ɾCalculationImpression() ɾCalculationCvr() ɾCalculationCtr() AdDataRepositoryInterface AdDataRepository

Slide 39

Slide 39 text

ϦϙδτϦύλʔϯͷϝϦοτɾσϝϦοτ RepositoryύλʔϯͷϝϦοτ - νʔϜͰιʔεͷ։ൃɾอक͕͠қ͍ - σʔλͷߏஙɺσʔλιʔεɺϏδωεϩδοΫʹมߋ͕ൃੜ͢Δ৔߹ɺιʔεͷมߋ͕গͳ ͘ࡁΉ - ϏδωεϩδοΫͱσʔλιʔεΛ෼͚ͯɺςετ͢Δࣄ͕Ͱ͖Δ RepositoryύλʔϯͷσϝϦοτ - ίʔυྔ͕ଟ͘ͳΔ - খن໛ͷҊ݅ͩͱɺٯʹϝϯςφϯείετ͕ߴ͘ͳΔɻ

Slide 40

Slide 40 text

ϦϙδτϦύλʔϯΛ࣮ࡍɺ࢖ͬͯΈͯͲ͏͔ͩͬͨʁ - ॳظஈ֊ͰෳࡶͳΫΤϦ͕গͳ͍৔߹ɺۭͬΆʹ͍ۙΫϥε͕ͨ͘͞Μ૿͑ ͯ͠·ͬͨɻ - ݁ہɺ໘౗ʹͳͬͨͷͰɺഇࢭ

Slide 41

Slide 41 text

αʔϏεΫϥεͬͯͲ͏ͳͷʁ αʔϏεΫϥεͱ͸ʁ UI ͔Β͚ͩͰͳ͘ɺCUIͷϓϩάϥϜͱ͔ ଞγεςϜͱͷ࿈ܞ෦෼ͱ͔Ͱɺڞ௨ͷϩ δοΫΛݺͿඞཁ͕͋Δͱ͖ʹɺService ϨΠϠʔӽ͠ʹυϝΠϯϩδοΫΛॲཧ͢ Δͱɺڞ௨ͷΠϯλϑΣʔεͰૢ࡞Ͱ͖Δ Α͏ʹͳΔ https://martinfowler.com/eaaCatalog/serviceLayer.html

Slide 42

Slide 42 text

αʔϏεΫϥεͷ࢖͍ํ ྫ͑͹ɺStripe APIΛ࢖ͬͨ ߪೖɾΩϟϯηϧॲཧͳͲΛ ॻ͍͍ͯ͘ https://martinfowler.com/eaaCatalog/serviceLayer.html

Slide 43

Slide 43 text

αʔϏεΫϥεΛ࣮ࡍɺ࢖ͬͯΈͯͲ͏͔ͩͬͨʁ - ֎෦αʔϏε(API)ͳͲΛୟ͘ॲཧ͚ͩ·ͱΊΔͷͰɺϩδοΫͷৼΓ෼͚ ͸͠΍͍͢ɻ - Model΍ϦϙδτϦΫϥεͰॻ͘Α͏ͳॲཧͱ͸ඃΒͳ͍ͷͰɺΘ͔Γ΍͢ ͍ɻ - தن໛ϓϩδΣΫτͰ΋ಋೖͯ͠΋த਎͕ബ͘ͳΒແͦ͞͏ɻ

Slide 44

Slide 44 text

ϑϩϯτΤϯυ શମߏ੒ αʔόαΠυ(API) ϒϥ΢β͔ΒΞΫηε͠ɺ ϢʔβIDͱύεϫʔυΛೖྗ Component HTML CSS JS Pages request.ts response.ts Types Resouce.php APIϦΫΤετ APIϨεϙϯε ϦΫΤετɾϨεϙϯεͷ ܕΛఆٛ Request.php router controller Model Database router όϦσʔγϣϯ Ϩεϙϯε஋Λ ఆٛ Service αʔυύʔςΟ Libs/api/index.ts

Slide 45

Slide 45 text

όοΫΤϯυΤϯυ σΟϨΫτϦߏ੒ ϦΫΤετɾ Ϩεϙϯε

Slide 46

Slide 46 text

όοΫΤϯυ Request.php όϦσʔγϣϯϧʔϧΛ ఆٛ͢Δ

Slide 47

Slide 47 text

όοΫΤϯυ Resource.php Ϩεϙϯε͕ՄࢹԽ͞Ε͍ͯΔɻ ඞཁͳ஋͚ͩฦͬͯ͘Δ

Slide 48

Slide 48 text

Tips - Open APIΛ࢖ͬͯɺAPI࢓༷ॻ݉ Swaggerͱͯ͠࢖͏ͱศརɻ - ϑϩϯτΤϯυͱόοΫΤϯυଆͰ ϦΫΤετɾϨεϙϯεͷڞ௨ೝࣝΛ࣋ ͯΔɻ - ࠷ѱɺόοΫΤϯυ͕஗Ԇ͍ͯ͠Δ࣌ ͸͜ͷAPI࢓༷Λࢀߟʹϑϩϯτͷ։ൃ ΛਐΊͨΓͯͨ͠ɻ https://swagger.io/resources/articles/documenting-apis-with-swagger/

Slide 49

Slide 49 text

Vue.js/Nuxt.jsͷߏ੒ʹ͍ͭͯ

Slide 50

Slide 50 text

NuxtͷσΟϨΫτϦߏ੒

Slide 51

Slide 51 text

ϑϩϯτΤϯυ શମߏ੒ αʔόαΠυ(API) ϒϥ΢β͔ΒΞΫηε͠ɺ ϢʔβIDͱύεϫʔυΛೖྗ Component HTML CSS JS Pages request.ts response.ts Types Resouce.php APIϦΫΤετ APIϨεϙϯε ϦΫΤετɾϨεϙϯεͷ ܕΛఆٛ Request.php router controller Model Database router όϦσʔγϣϯ Ϩεϙϯε஋Λ ఆٛ Service αʔυύʔςΟ Libs/api/index.ts

Slide 52

Slide 52 text

ϑϩϯτΤϯυ σΟϨΫτϦߏ੒ APIͷϦΫΤετɾϨε ϙϯεͷఆٛ ϛυϧ΢ΣΞ APIϦΫΤετ constͳͲ Axios΍ϥΠϒ ϥϦͳͲ

Slide 53

Slide 53 text

ϑϩϯτΤϯυ request.ts ܕΛinterfaceͰఆٛ

Slide 54

Slide 54 text

ϑϩϯτΤϯυ index.ts APIΛϦΫΤετ

Slide 55

Slide 55 text

ΞτϛοΫσβΠϯͬͯͲ͏ͳͷʁ ΞτϛοΫσβΠϯͱ͸ʁ 5ͭͷ֊૚ʹ෼͚ɺ࠷ऴతͳUIͱUIͷجૅͱͳΔ σβΠϯγεςϜΛಉ࣌ʹ࡞੒͢Δઃܭํ๏ɻ - ݪࢠʢAtomʣ: ࠷΋খཻ͍͞౓ͷཁૉ - ෼ࢠʢmoleculeʣ: 2ͭҎ্ͷݪࢠΛ૊Έ߹Θͤͨγϯ ϓϧͳUIཁૉ - ༗ػମʢorganismʣ: ੾Γ཭ͯ͠୯ମͰ΋ػೳ͢Δ෼ ࢠͷू·Γ - ςϯϓϨʔτʢTemplatesʣ: ͍͔ͭ͘ͷ༗ػମɾ෼ ࢠɾݪࢠ͔Β੒Γཱ͍ͬͯΔࠎ૊Έ - ϖʔδʢPagesʣ: ςϯϓϨʔτʹ࣮ࡍͷίϯςϯπ Λద༻ͨ͠΋ͷ https://uxdaystokyo.com/articles/glossary/atomic-design/

Slide 56

Slide 56 text

ΞτϛοΫσβΠϯͬͯͲ͏ͳͷʁ ࢖ͬͯΈͨײ૝ - ࡉ͔͘ͲͷίʔυΛ5૚ʹৼΓ෼͚Δ͔ͷ൑அ͕೉͍͠ɻ - ্ख͘ৼΓ෼͚ΒΕͳ͍ͱ͔͑ͬͯɺΑ͘Θ͔Βͳ͘ͳͬͯ ͠·ͬͨɻ - զʑʹ͸·ͩΞτϛοΫσβΠϯ͸ૣ͔ͬͨɻϓϩδΣΫτ ಺ʹ༗ࣝऀ͕͍ͳ͍ͱ೉͍͠ɻ

Slide 57

Slide 57 text

ΞτϛοΫσβΠϯͬͯͲ͏ͳͷʁ ࠷ऴతʹͲ͏͔ͨ͠ʁ
 - σβΠϯγεςϜͷ୯ҐͰίϯ ϙʔωϯτΛ੾͍ͬͯ͘ͱ੔ཧ͕ Ͱ͖ͨɻ - ͳͷͰɺॳظஈ֊ͰσβΠφʔ͞ ΜʹͪΌΜͱσβΠϯγεςϜΛ ࡞ͬͯ΋Β͏͜ͱΛ͓નΊ͠· ͢ɻ

Slide 58

Slide 58 text

LintͷઃఆͳͲ

Slide 59

Slide 59 text

ϑϩϯτΤϯυ αʔόαΠυ ֤lintͷઃఆ Gitlab CI ςετɾLintͳͲ ςετɾLintͳͲ ֤lint

Slide 60

Slide 60 text

੩తղੳͷઃఆ phpcs.xml - PSR12ͷνΣο ΫͳͲ

Slide 61

Slide 61 text

੩తղੳͷઃఆ phpmd.xml - ίʔυαΠζͷνΣοΫ - ࢖ΘΕ͍ͯͳ͍ίʔυͷ νΣοΫ - ม਺໊ͳͲͷνΣοΫ

Slide 62

Slide 62 text

੩తղੳͷઃఆ eslint - AirbnbͷJavaScript Style GuideΛίʔσΟϯάن໿ͱ ͢Δɻ - Prettier ͳͲ https://www.wantedly.com/companies/askul/post_articles/155377

Slide 63

Slide 63 text

੩తղੳͷઃఆ stylelint - CSSͷߏจΤϥʔ - ϑΥʔϚοτͱҰ؏ੑ - ελΠϧͷॏෳΛݮΒ͢ ͳͲ https://www.webprofessional.jp/taking-css-linting-next-level-stylelint/

Slide 64

Slide 64 text

'BU$POUSPMMFSΛ๷͙

Slide 65

Slide 65 text

ɾFatControllerʢଠͬͨίϯτϩʔϥʣͷ͜ͱͰ͢ɻͳΜͰଠΔ͔ͱݴ͏ͱ୲͏੹຿͕ଟ͍ ͔ΒͰ͢ɻྫ͑͹ɺԼهͷΑ͏ͳཧ༝͕ߟ͑ΒΕ·͢ɻ ɾෳ਺ͷϝιουͰॲཧ͕ॏෳ͍ͯ͠Δɻ ɾ୯७ʹΞΫγϣϯϝιου͕ଟ͍ɻ ɾϩδοΫ͕ଟ͗͢Δɻ ɾͻͱͭͷมߋ͕ଞͷ෦෼ʹٴ΅͢ӨڹΛݕ஌ͮ͠Β͍ঢ়ଶʹ͋Δ Fat Controller ͱ͸ʁ

Slide 66

Slide 66 text

ɾControllerͷ੹຿ͷൣғ֎ͷॲཧ΋ೖ͖ͬͯͯ͠·͏ɻ ɹɹControllerͷ੹຿͸ ɹɹ- ೖྗʢHTTPϦΫΤετʣΛड͚औΓɺνΣοΫ͢Δ ɹɹ- ద੾ͳॲཧܥ΁஋Λ౉͢ ɹɹ- ϨεϙϯεΛฦ͢ ɹɹͷ̏ͭͱݴΘΕ͍ͯ·͢ɻ ɾҰͭҰͭͷॲཧ͕௕ͯ͘ɺॲཧΛ௥͏ͷ͕೉͍͠ɻ ɾॲཧͷॏෳ͕ଟ͍ͷͰɺ࢓༷มߋ͕͋ͬͨ࣌ʹमਖ਼͕೉͍͠ɻ Fat Controller͸ԿͰྑ͘ͳ͍ͷ͔ʁ https://eh-career.com/engineerhub/entry/2021/05/28/160000#Laravel%E3%81%AE%E4%BE%8B%E3%81%AB%E8%A6%8B%E3%82%8BFatModel

Slide 67

Slide 67 text

ϦϑΝΫλ಺༰

Slide 68

Slide 68 text

privateϝιουʹ੾Γ෼͚Δ Ұͭͷϝιου͕50ߦΛ௒͑ͦ͏ͳ Βɺॲཧ͝ͱʹprivateϝιουʹ෼ ͚Δ

Slide 69

Slide 69 text

modelΫϥεʹϩδοΫΛ෼͚Δ ControllerʹϩδοΫ͕૿͖͑ͯͨ ΒɺmodelʹॲཧΛ෼͚Δ

Slide 70

Slide 70 text

όϦσʔγϣϯ͸RequestΫϥεʹॻ͘ ControllerʹόϦσʔγϣϯΛ௚ॻ ͖͠ͳ͍ͰRequestΫϥεͰॲཧ͢ Δ

Slide 71

Slide 71 text

ෳ਺ͷ Controller ʹ෼཭͢Δ ҰͭͷControllerͰΞΫγϣϯϝ ι ο υ ͕ ૿ ͑ ͢ ͗ Δ ৔ ߹ ͸ ɺ ControllerϑΝΠϧ͝ͱ෼͚Δ

Slide 72

Slide 72 text

ϨεϙϯεͷσʔλΛResource ʹॻ͘ Ϩεϙϯεσʔλ͕ෳࡶԽ͖ͯͨ͠ ΓɺՃ޻͕ඞཁͳ৔߹͸ResouceΫ ϥεʹ෼͚Δ

Slide 73

Slide 73 text

ϦϑΝΫλ·ͱΊ ɾControllerͷ੹຿ͷൣғ֎ͷॲཧ͸ೖΕͳ͍ɻ ɾඞཁʹԠͯ͡ɺϩδοΫͷ૚Λ૿΍͢ɻ ɾॲཧΛࡉ෼Խͯ͠ɺॏෳ͢Δॲཧ͸·ͱΊΔɻ

Slide 74

Slide 74 text

Copyright Re:Build.inc All Rights Reserved. ·ͱΊ - ܕ΍ϦΫΤετɾϨεϙϯεΛՄࢹԽͯ͠ɺΤϥʔͷ੾Γ෼͚Λ͠΍͘͢͢ Δɻ
 - LintΛ͔ͬ͠Γಋೖ͢Δ͜ͱͰɺେਓ਺΍ΦϑγϣΞ։ൃͳͲͷϓϩδΣΫτ Ͱ΋ॻ͖ํΛ౷Ұ͢Δɻ
 - ֤૚ͷ໾ׂΛϋοΩϦͤͯ͞ɺίʔυΛಡΈ΍͘͢͢ΔɻFat Controller͸ආ͚ Δɻ อकੑΛߴΊΔʹ͸ʁ

Slide 75

Slide 75 text

Copyright Re:Build.inc All Rights Reserved. ·ͱΊ ͜ΕͳΒɺ෭ۀɺϑϦʔϥϯεɺΦϑγϣΞ ͍ΖΜͳਓ͕ೖͬͯ΋҆৺ʂʂʂʂ