Upgrade to Pro — share decks privately, control downloads, hide ads and more …

モバイルアプリ向けAPI
開発を通じて学んだこと / learned-from-developing-mobile-app-api

hypermkt
March 30, 2019

モバイルアプリ向けAPI
開発を通じて学んだこと / learned-from-developing-mobile-app-api

バーチー / GMO Pepabo, Inc.
2019.03.30 PHPerKaigi 2019
https://phperkaigi.jp/2019/

■ 関連資料
Laravelでエラーコードを含む独自エラーレスポンスを返す方法 - Qiita https://qiita.com/hypermkt/items/78e878bb38cc63e40b2b

hypermkt

March 30, 2019
Tweet

More Decks by hypermkt

Other Decks in Programming

Transcript

  1. όʔνʔ(.01FQBCP *OD
    1)1FS,BJHJ
    ϞόΠϧΞϓϦ޲͚"1*

    ։ൃΛ௨ֶͯ͡Μͩ͜ͱ

    View full-size slide

  2. όʔνʔ

    !IZQFSNLU
    γχΞΤϯδχΞ

    ࣗݾ঺հ


    View full-size slide

  3. 1)1FS,BJHJ͸࠙਌ձ-5ࢀՃ


    1)1FS,BJHJ͸࠙਌ձ-5ࢀՃ

    View full-size slide

  4. (PPQFʹ͍ͭͯ
    wIUUQTHPPQFKQ

    wॳ৺ऀ޲͚αʔϏε

    ϗʔϜϖʔδ࡞੒αʔϏε

    w໿ ਓͷϢʔβʔ༷͕ར༻


    View full-size slide

  5. ࿩͢͜ͱ
    w എܠͱ໨త
    w ϞόΠϧ"1*։ൃͰࢲୡ͕৐Γӽ͑ͨน
    w ࣮ݱٕज़ͷબ୒
    w "1*ઃܭ
    w ಡॻձʹΑΔڞ௨஌ࣝͷཱ֬
    w 3&45GVM"1*ઃܭ
    w "1*ઃܭͰͷࣦഊɾɾɾ
    w -BSBWFM"1*ೝূͷ࣮૷
    w ͦ΋ͦ΋0"VUIʹ͍ͭͯ
    w -BSBWFMʹ͓͚Δ0"VUIͷ࣮ݱํ๏
    w Τϥʔ࣌ͷ"1*Ϩεϙϯεઃܭ
    w ·ͱΊ

    View full-size slide



  6. ೥݄೔ϦϦʔε

    View full-size slide

  7. എܠ
    w(PPQF͸αʔϏε։͔࢝Β೥໨ͷϗʔϜϖʔδ࡞੒αʔϏε
    wطଘαʔϏε޲͚ͷJ04ΞϓϦ։ൃϓϩδΣΫτ
    w։ൃνʔϜͱͯ͠ຊ֨తͳϞόΠϧΞϓϦ։ൃ͸ॳ
    wߏ૝ʙϦϦʔε·Ͱ໿೥ͷ௕ظϓϩδΣΫτ


    View full-size slide

  8. J04ΞϓϦػೳ֓ཁ
    wϩάΠϯ
    wϗʔϜϖʔδ؅ཧػೳ
    w͓஌Βͤ؅ཧ
    w͓໰͍߹Θͤ؅ཧ
    wΞΫηεղੳ
    wϓογϡ௨஌ʹΑΔ͓໰͍߹Θͤ௨஌


    View full-size slide

  9. ໨త
    wϞόΠϧΞϓϦ޲͚ͷ"1*Λ-BSBWFMΛར༻ͯ͠৽ن։ൃ
    wۤ࿑ͨ͠ɾ޻෉ͨ͠ɾ͏·͍͔͘ͳ͔ͬͨ఺Λ঺հ
    wࢲͷܦݧɾֶͼΛڞ༗͠օ͞Μͷྐʹͯ͠΋Β͍͍ͨ


    View full-size slide

  10. ࿩͢͜ͱ
    w എܠͱ໨త
    w ϞόΠϧ"1*։ൃͰࢲୡ͕৐Γӽ͑ͨน
    w ࣮ݱٕज़ͷબ୒
    w "1*ઃܭ
    w ಡॻձʹΑΔڞ௨஌ࣝͷཱ֬
    w 3&45GVM"1*ઃܭ
    w "1*ઃܭͰͷࣦഊɾɾɾ
    w -BSBWFM"1*ೝূͷ࣮૷
    w ͦ΋ͦ΋0"VUIʹ͍ͭͯ
    w -BSBWFMʹ͓͚Δ0"VUIͷ࣮ݱํ๏
    w Τϥʔ࣌ͷ"1*Ϩεϙϯεઃܭ
    w ·ͱΊ

    View full-size slide

  11. ͱ͋ΔطଘαʔϏεͰ


    ԿͰ͜ΕΛ࢖͍ͬͯΔΜͩΖ͏ʁ

    ͋ΕͳΒ΋ͬͱྑ͔ͬͨͷʹ

    View full-size slide



  12. طଘαʔϏεͷྺ࢙ʹ͓͍ͯ

    ୭͔͕ٕज़બఆΛͯ͠ࠓ͕͋Δ

    View full-size slide



  13. ৽نαʔϏε։ൃ࣌͸ٕज़બఆͷ࿈ଓ

    View full-size slide



  14. ݁ߏେมͰ͢

    View full-size slide

  15. ͳͥେม͔
    wܾΊΔ͜ͱ͕ଟ͍
    w෯޿͍஌͕ࣝඞཁ
    wٕज़બఆ͸Ұ౓ܾΊΔͱ಺༰ʹΑͬͯ͸؆୯ʹ͸

    มߋͰ͖ͳ͍
    wࣗ෼͕ܾΊͨબ୒͕ਖ਼͍͠ͷ͔ෆ҆


    View full-size slide



  16. Ͳ͏͢Ε͹ࣦഊͤͣʹٕज़બఆ͕
    Ͱ͖Δ͔ʁ

    View full-size slide



  17. ʲେલఏʳ


    αʔϏεཁ݅ͷ໢ཏੑ

    View full-size slide

  18. αʔϏεཁ݅
    w୭ͷͨΊʹطଘϢʔβʔ
    wͳͥ˓˓ͷ໰୊Λղܾ͢ΔͨΊ
    wԿΛ˘˘ΛఏڙΛ͢Δ
    w͍ͭ˚݄ࠒϦϦʔε


    View full-size slide

  19. ٕज़બఆͷϙΠϯτ
    wαʔϏεཁ݅Λຬͨ͢ͷ͔
    w։ൃνʔϜͰӡ༻Ͱ͖Δ͔ Ϟνϕʔγϣϯͱ΋ؔ܎

    wֶशίετ
    wকདྷੑ
    wεέʔϧ͢Δ͔
    wඞཁੑ


    View full-size slide

  20. ܾΊํ
    wީิΛग़ͯ͠৚݅Λ·ͱΊΔ
    wͦͯ͠࠷ऴީิΛબఆ͠ඞવੑͷཧ༝Λड़΂Δ


    View full-size slide

  21. 8FCϑϨʔϜϫʔΫͷબ୒ྫ
    w ཁ݅ຬͨ͢
    w ։ൃνʔϜͱͷ਌࿨ੑશһ1)1FS-BSBWFM޷͖ͳਓ΋͍Δ
    w ඞཁՄ൱ඞཁ ंྠͷ࠶ൃ໌͸ͨ͘͠ͳ͍
    w কདྷੑ༗Γ
    w ީิ-BSBWFM -VNFO
    w -VNFO͸ཁ݅Λຬͨͨ͢Ίʹ޻෉΍ௐ੔͕ඞཁɺ-BSBWFM1BTTQPSUΛ

    ඇαϙʔτ
    w 1)1FS,BJHJͷ-BSBWFM૬ஊձͰZUBLF͞Μʹ૬ஊܾͯ͠Ίͨ


    -BSBWFM͔ΒίϯϙʔωϯτΛҾ͘ͷ͸؆୯͕ͩ-VNFOʹ଍͢ͷ͸ࠔ೉

    View full-size slide



  22. -BSBWFMʹܾఆ

    View full-size slide

  23. ·ͱΊ
    wϩδοΫΛ૊ΜͰٕज़બఆΛߦͬͨ
    wେࣄͳ͜ͱ͸ࣗ෼ͷݴ༿Ͱඞવੑͷཧ༝Λ͔ͬ͠Γ
    ड़΂Δ
    w໎ͬͨΒৄ͍͠ਓʹҙݟΛٻΊΔ
    w͕͔ͩ͠͠ɺਖ਼௚બ୒ͨ݁͠Ռ͕੒ޭ͔ͨ͠͸

    ཱ͕࣌ؒͨͳ͍ͱ෼͔Βͳ͍͜ͱ΋͋Δ
    wࣗ৴Λ࣋ͭ


    View full-size slide

  24. ࿩͢͜ͱ
    w എܠͱ໨త
    w ϞόΠϧ"1*։ൃͰࢲୡ͕৐Γӽ͑ͨน
    w ࣮ݱٕज़ͷબ୒
    w "1*ઃܭ
    w ಡॻձʹΑΔڞ௨஌ࣝͷཱ֬
    w 3&45GVM"1*ઃܭ
    w "1*ઃܭͰͷࣦഊɾɾɾ
    w -BSBWFM"1*ೝূͷ࣮૷
    w ͦ΋ͦ΋0"VUIʹ͍ͭͯ
    w -BSBWFMʹ͓͚Δ0"VUIͷ࣮ݱํ๏
    w Τϥʔ࣌ͷ"1*Ϩεϙϯεઃܭ
    w ·ͱΊ

    View full-size slide

  25. ಡॻձʹΑΔڞ௨ೝࣝͷཱ֬

    View full-size slide

  26. ՝୊
    wͪΌΜͱͨ͠"1*ઃܭɾ։ൃ͕։ൃνʔϜશһະܦݧ
    w"1*։ൃऀɾΞϓϦΤϯδχΞؒͰڞ௨ͷ஌͕ࣝແ͍
    wࠓޙ"1*ઃܭɾ։ൃ͕Ͱ͖Δͷ͔ෆ҆


    View full-size slide

  27. 8FC"1*5IF(PPE1BSUT
    ಡॻձ


    View full-size slide

  28. 8FC"1*5IF(PPE1BSUT
    w8FC"1*ʹ͍ͭͯ෯޿͘ղઆ
    w ΤϯυϙΠϯτઃܭ
    w ϦΫΤετͷܗࣜ
    w Ϩεϙϯεσʔλͷઃܭ
    w )551εςʔλεͷ࢓༷
    w ηΩϡϦςΟ


    SFGTIUUQTXXXPSFJMMZDPKQCPPLT

    View full-size slide

  29. ಡॻձͰ஌ࣝͷఈ্͛
    wܦඅͰશһ෼ߪೖ
    wຖ೔෼։ൃνʔϜશһͰಡΉ
    wϲ݄Ͱಡഁ
    w୹ظؒʜ


    View full-size slide

  30. ಡॻձͷ੒Ռ
    w໛ൣͱͳΔ"1*ઃܭͷجૅ஌ࣝશൠֶ͕΂ͨ
    w"1* ΞϓϦΤϯδχΞؒͰڞ௨ݴޠ͕Ͱ͖ٞ࿦

    Ͱ͖Δঢ়ଶʹͳͬͨ
    wୠ͠׬ᘳͰ͸ͳ͍ɻ͋͘·Ͱجૅɻ


    View full-size slide



  31. Αʔ͠ɺ"1*ͷઃܭΛ͢Δͧʔ

    View full-size slide



  32. "1*ઃܭͬͯԿͰ΍Γ·͢ʁ

    ԿͰυΩϡϝϯτʹ࢒͠·͢ʁ

    εϓϨουγʔτ 8JLJ

    View full-size slide

  33. 3&45GVM"1*ઃܭ

    View full-size slide

  34. ՝୊
    3&45GVM"1*ઃܭ

    "1*։ൃऀɾΞϓϦΤϯδχΞؒͰͲͷΑ͏ʹͯ͠"1*ઃܭ
    Λڠٞ͢Δͷ͔

    "1*υΩϡϝϯτ

    ܾ·ͬͨ"1*ઃܭΛͲͷΑ͏ʹυΩϡϝϯτͱͯ͠

    ؅ཧɾڞ༗͢Δͷ͔


    View full-size slide

  35. "1*ઃܭʹٻΊΔ΋ͷ


    w1VMM3FRVFTUϕʔεͰ૬ޓʹϨϏϡʔΛ͍ͨ͠
    w੒Ռ෺Ͱ͋Δઃܭॻ͸Մಡੑͷߴ͍υΩϡϝϯτʹ͍ͨ͠

    View full-size slide

  36. 4XBHHFSͱ͸
    w3&45GVM"1*Λߏங͢ΔͨΊͷϑϨʔϜϫʔΫ
    w4XBHHFS4QFD &EJUPS 6* $PEFHFOͳͲͷπʔϧ܈Ͱ
    ։ൃΛαϙʔτ


    View full-size slide

  37. 4XBHHFS4QFDͰ"1*ઃܭ
    wZBNMϑΝΠϧͰઃܭΛఆٛ
    w13্Ͱ"1*։ൃऀɾΞϓϦΤϯδχΞ૒ํͰϨ
    Ϗϡʔ


    SFGTIUUQTTXBHHFSJPEPDTTQFDJpDBUJPOBEEJOHFYBNQMFT

    View full-size slide

  38. 4XBHHFS&EJUPSΛ"1*υΩϡϝϯτʹ


    View full-size slide



  39. πʔϧ͸͋͘·Ͱπʔϧ
    ຊ࣭తͳ՝୊͸

    ཁ݅Λຬͨ͢ઃܭ͕Ͱ͖Δ͔

    View full-size slide

  40. "1*ઃܭͰ਺ʑͷࣦഊΛ͢Δʜ

    View full-size slide



  41. "1*ઃܭ͕Ұ൪ۤ࿑͠·ͨ͠

    View full-size slide

  42. ਺ʑͷࣦഊΛॏͶΔʜ
    w࣮͸λοϓͰ͖Δ࢓༷Λݟམͱ͢
    wը໘্ͷ਺ࣈͷҙຯΛऔΓҧ͑Δ
    w˛Λݟམͱ͢


    View full-size slide



  43. ݁࿦
    "1*ઃܭΛ͢Δલʹ

    σβΠφʔɾΫϥΠΞϯτɾ"1*։ൃऀͷ

    ೝࣝΛ߹ΘͤΔ͜ͱ͕େ੾

    View full-size slide

  44. "1*ઃܭͷֶͼ
    w͍͖ͳΓ"1*ઃܭʹೖΒͳ͍
    wσβΠφʔɾΫϥΠΞϯτɾ"1*։ൃऀͰ

    ը໘Λݟͳ͕Βཁ݅Λඞͣ֬ೝΛ͢Δ

    ʢ1SPUUͳͲͰಈ͖΋֬ೝͰ͖Δͱঘྑ͍ʣ


    "1*ઃܭͰೝࣝҧ͍ͷ··࣮૷ʹೖΔͱΞϓϦͱ݁߹͢Δ·Ͱ໰୊ʹؾ͔ͮͳ͍ɻ
    ͱʹ͔͘"1*ઃܭʹ͸૒ํͷཧղʹ࣌ؒΛ͔͚Δ͕٢ɻ

    View full-size slide

  45. ࿩͢͜ͱ
    w എܠͱ໨త
    w ϞόΠϧ"1*։ൃͰࢲୡ͕৐Γӽ͑ͨน
    w ࣮ݱٕज़ʢ8FCϑϨʔϜϫʔΫʣͷબ୒
    w "1*ઃܭ
    w ಡॻձʹΑΔڞ௨஌ࣝͷཱ֬
    w 3&45GVM"1*ઃܭ
    w "1*ઃܭͰͷࣦഊɾɾɾ
    w -BSBWFM"1*ೝূͷ࣮૷
    w ͦ΋ͦ΋0"VUIʹ͍ͭͯ
    w -BSBWFMʹ͓͚Δ0"VUIͷ࣮ݱํ๏
    w Τϥʔ࣌ͷ"1*Ϩεϙϯεઃܭ
    w ·ͱΊ

    View full-size slide

  46. αʔϏεͷϩάΠϯ*%18ͰϩάΠϯ͍ͨ͠


    View full-size slide

  47. "1*ೝূ
    w ϩάΠϯपΓͷ"1*ೝূʹ͸ɺ0"VUI͕ඪ४తͳ࢓༷
    w 8FC"1*ʹ͓͍ͯ޿͘Ұൠతʹར༻͞Ε͍ͯΔ


    View full-size slide

  48. ͦ΋ͦ΋0"VUIʹ͍ͭͯ

    View full-size slide

  49. ͦ΋ͦ΋0"VUIʹ͍ͭͯ
    w 0"VUIͱ͸ɺ8FCαʔόʔʹ͋ΔϢʔβʔͷϦιʔε΁ͷ
    ΞΫηεݖݶΛɺϢʔβʔͷ୅ཧͰߦ͏͜ͱΛڐՄ͢Δ

    ͨΊͷೝূ༻ͷϓϩτίϧͷ͜ͱͰ͋Δ


    ग़య8FCMJPࣙॻ
    ؆୯ʹݴ͑͹ɺଞͷΞϓϦʹΞΫηεݖΛ༩͑Δ࢓૊Έ

    View full-size slide

  50. αʔϏεͷϩάΠϯ*%18ͰϩάΠϯ͍ͨ͠


    View full-size slide

  51. 0"VUI

    3FTPVSDF0XOFS1BTTXPSE$SFEFOUJBMT(SBOU
    w 0"VUIͷೝূํࣜͷҰͭ
    w Ϣʔβʔ໊ͱύεϫʔυΛड͚औΓΞΫηετʔΫϯΛൃߦ͢Δ



    ΫϥΠΞϯτ

    Ϧιʔε

    αʔόʔ

    ೝՄαʔόʔ
    Ϣʔβʔ
    ᶃೝূ৘ใΛೖྗ
    ᶄΞΫηετʔΫϯͷϦΫΤετΛૹ৴
    ᶅΞΫηετʔΫϯ͸͜ΕͰ͢ʔ
    ᶆσʔλ͍ͩ͘͞

    View full-size slide

  52. -BSBWFMʹ͓͚Δ0"VUIͷ࣮ݱํ๏

    View full-size slide

  53. -BSBWFM1BTTQPSU࠾༻ͷཧ༝
    w 1BTTQPSU͸0"VUIαʔόʔͱ"1*ೝূύοέʔδ
    w -BSBWFMެࣜ
    w ಋೖ͕؆୯
    w ֤छ(SBOU5ZQFʹରԠ
    w υΩϡϝϯτ͕ॆ࣮ ೔ຊޠ຋༁༗Γ



    View full-size slide

  54. ՝୊


    w -BSBWFM1BTTQPSUͷσϑΥϧτઃఆͱ͍Ζ͍ΖҟͳΔ
    w ϩάΠϯ৘ใΛอ࣋͢Δςʔϒϧ໊
    w Ϣʔβʔ໊ɾύεϫʔυΛอ࣋͢ΔΧϥϜ໊
    w ύεϫʔυͷೝূํࣜ

    View full-size slide

  55. 1BTTQPSUσϑΥϧτͱҟͳΔ఺


    1BTTQPSU (PPQF
    ςʔϒϧ໊ VTFST U@VTFS ྫ

    Ϣʔβʔ໊ VTFSOBNF MPHJO@JE ྫ

    ೝূํ๏ CDSZQU ಠࣗ

    View full-size slide



  56. υΩϡϝϯτʹ͸ೝূͷมߋํ๏ʹ͍ͭͯ

    هࡌ͕ແ͍

    View full-size slide









  57. 3FRVFTU 3FTQPOTF
    "QQMJDBUJPO
    $POUSPMMFS
    .JEEMFXBSF
    ೝূΨʔυ
    4FTTJPO(VBSE
    5PLFO(VBSE 6TFS1SPWJEFS
    %#
    "VUIFOUJDBUF
    ͜ͷ3FRVFTU

    ௨ͯ͠΋͍͍ʁ
    ͜ͷೝূ৘ใͷϢʔβʔͬͯ

    %#ʹ͋Δʁ
    4&-&$5'30.VTFST

    8)&3&VTFSOBNFbYY`

    QBTTXPSEbZZ`
    ͲͷΑ͏ʹϢʔβʔ৘ใΛऔಘ͢Δ͔Λఆٛ
    ϢʔβʔϓϩόΠμʔ
    ϦΫΤετຖʹͲͷΑ͏ʹϢʔβʔΛ

    ೝূ͢Δ͔Λఆٛ
    ਤղ

    View full-size slide









  58. 3FRVFTU 3FTQPOTF
    "QQMJDBUJPO
    $POUSPMMFS
    .JEEMFXBSF
    ೝূΨʔυ
    4FTTJPO(VBSE
    5PLFO(VBSE
    1BTTQPSU

    5PLFO(VBSE
    6TFS1SPWJEFS
    %#
    "VUIFOUJDBUF
    ͲͷΑ͏ʹϢʔβʔ৘ใΛऔಘ͢Δ͔Λఆٛ
    ϢʔβʔϓϩόΠμʔ
    ϦΫΤετຖʹͲͷΑ͏ʹϢʔβʔΛ

    ೝূ͢Δ͔Λఆٛ
    -BSBWFMa1BTTQPSU

    a#SJEHFa6TFS3FQPTJUPSZ
    0"VUIೝূͳΒ೚ͤͯ
    -BSBWFM1BTTQPSUͰͷ

    Ϣʔβʔऔಘ͢ΔͰ
    ਤղ

    View full-size slide

  59. Ϣʔβʔ৘ใͷऔಘ


    View full-size slide

  60. ύεϫʔυೝূ


    View full-size slide



  61. طଘͷ࢓༷ʹ߹ΘͤͨϞσϧΛ༻ҙͯ͠ɺ

    ॲཧΛΦʔόʔϥΠυ͠ɺ

    ͦΕΛϢʔβʔϓϩόΠμʔࢦఆ͢Ε͹

    Ͱ͖ͦ͏

    View full-size slide









  62. 3FRVFTU 3FTQPOTF
    "QQMJDBUJPO
    $POUSPMMFS
    .JEEMFXBSF
    ೝূΨʔυ
    4FTTJPO(VBSE
    5PLFO(VBSE
    1BTTQPSU

    5PLFO(VBSE
    %#
    "VUIFOUJDBUF
    ͲͷΑ͏ʹϢʔβʔ৘ใΛऔಘ͢Δ͔Λఆٛ
    ϢʔβʔϓϩόΠμʔ
    ϦΫΤετຖʹͲͷΑ͏ʹϢʔβʔΛ

    ೝূ͢Δ͔Λఆٛ
    -BSBWFMa1BTTQPSUa#SJEHFa6TFS3FQPTJUPSZ
    0"VUIೝূͳΒ೚ͤͯ
    /FX1SPWJEFS
    6TFS1SPWJEFS

    View full-size slide

  63. U@BDDPVOUςʔϒϧ͕͋ͬͨͱ͢Δ


    View full-size slide

  64. Ϣʔβʔೝূ༻ͷ&MPRVFOUϞσϧΛ༻ҙ
    w "VUIFOUJDBUBCMFΛܧঝɻ

    ͜Ε͕ແ͍ͱೝূ༻ϞσϧʹͳΒͳ͍ɻ
    w 1BTTQPSUͷ)BT"QJ5PLFOτϨΠτΛ

    Πϯϙʔτ


    View full-size slide

  65. pOE'PS1BTTQPSUΛΦʔόʔϥΠυ


    wطଘͷςʔϒϧઃܭʹ߹ΘͤͨϢʔβʔऔಘํࣜʹมߋ

    View full-size slide

  66. WBMJEBUF'PS1BTTQPSU1BTTXPSE(SBOUΛ࣮૷


    w طଘͷςʔϒϧઃܭʹ߹Θͤͨύεϫʔυೝূํࣜʹมߋ
    wʲ஫ҙʳ͜Ε͸ྫͰ͢

    View full-size slide

  67. ઐ༻ͷϢʔβʔϓϩόΠμʔʹ੾Γସ͑


    DPOpHBVUIQIQ
    ᶃϢʔβʔϓϩόΠμʔΛ

    ௥Ճ͢Δ
    ᶄ1BTTQPSUESJWFSͷ

    ϢʔβʔϓϩόΠμʔΛ੾Γସ͑Δ

    View full-size slide

  68. ೝূͰ͖ΔΑ͏ʹͳͬͨ


    View full-size slide

  69. ϚχϡΞϧʹશͯஸೡʹ͸ॻ͔Ε͍ͯͳ͍


    ιʔείʔυΛݟͯ࢓༷Λ೺Ѳ͢Δ͜ͱ΋ඞཁ


    View full-size slide

  70. ࿩͢͜ͱ
    w എܠͱ໨త
    w ϞόΠϧ"1*։ൃͰࢲୡ͕৐Γӽ͑ͨน
    w ࣮ݱٕज़ͷબ୒
    w "1*ઃܭ
    w ಡॻձʹΑΔڞ௨஌ࣝͷཱ֬
    w 3&45GVM"1*ઃܭ
    w "1*ઃܭͰͷࣦഊɾɾɾ
    w -BSBWFM"1*ೝূͷ࣮૷
    w ͦ΋ͦ΋0"VUIʹ͍ͭͯ
    w -BSBWFMʹ͓͚Δ0"VUIͷ࣮ݱํ๏
    w Τϥʔ࣌ͷ"1*Ϩεϙϯεઃܭ
    w ·ͱΊ

    View full-size slide

  71. ՝୊
    w 3&45GVM"1*ͰͷΤϥʔϋϯυϦϯά͸)551εςʔλε
    ίʔυͰ͓͓Αͦ൑அՄ
    w ͔͠͠ɺΞϓϦέʔγϣϯݻ༗ͷΤϥʔͩͬͨ৔߹͸
    )551εςʔλείʔυ͚ͩͰ͸දݱग़དྷͳ͍


    View full-size slide

  72. ͍ͨ͜͠ͱ
    w ΫϥΠΞϯτ͕ϋϯυϦϯά͠΍͍͢TUSJOH΍JOUͷΤ
    ϥʔίʔυϑΟʔϧυ DPEF
    Λฦ͢
    w ΞϓϦΤϯδχΞ͔Βͷཁ๬Ͱશͯͷύλʔϯʹ͓͍ͯ

    ڞ௨ͷΤϥʔϨεϙϯεॻࣜͱ͢Δ


    View full-size slide

  73. -BSBWFMͰͷ࣮૷ํ๏
    w -BSBWFM͔Βಋೖ͞Εͨ
    *MMVNJOBUFa$POUSBDUTa4VQQPSUa3FTQPOTBCMF

    ΠϯλʔϑΣʔεΛར༻ͯ͠ྫ֎ΫϥεͱϨεϙϯεΛ

    ؔ࿈෇͚Δ
    w "QQa&YDFQUJPOTa)BOEMFSΫϥεͷSFOEFSϝιουͰ
    ϨεϙϯεΛ੍ޚ͢Δ


    View full-size slide

  74. 3FTQPOTBCMFΠϯλʔϑΣʔε
    w 3FTQPOTBCMFΠϯλʔϑΣʔεͷUP3FTQPOTFϝιουΛ࣮૷
    w ΞϓϦέʔγϣϯ಺͔Βྫ֎ΛUISPX͢Ε͹ࢦఆͷϨεϙϯε͕

    ฦ٫Ͱ͖Δ


    0SJHJOBM

    3FTQPOTF
    $POUSPMMFST 3FTQPOTBCMF
    UISPX όʔϯ
    {
    "title": "width and height is required",
    "code": "wrong_query_parameter"
    }
    Ϩεϙϯεྫ

    View full-size slide

  75. ࢦఆҎ֎͸-BSBWFMඪ४ͷΤϥʔϨεϙϯε͕ฦΔ
    {
    "message": "Server Error”
    }


    w ΫϥΠΞϯτଆ ϞόΠϧΞϓϦ
    ͱͯ͠͸ڞ௨Խ͞Εͳ͍ͱ

    ΤϥʔϋϯυϦϯά͕͠ਏ͍ͱ͍͏՝୊͕͋ͬͨ

    View full-size slide

  76. "QQa&YDFQUJPOa)BOEMFSͷSFOEFSϝιου
    w ྫ֎Τϥʔ͕ൃੜ͢ΔͱSFOEFSͰϨεϙϯεΛ੍ޚͯ͠ฦ͢
    w ྫ֎λΠϓʹԠͯ͡޷͖ʹϨεϙϯεΛฦͯ͠ྑ͍


    refs: https://readouble.com/laravel/5.8/ja/errors.html

    View full-size slide

  77. ΤϥʔϨεϙϯεͷڞ௨Խྫ


    "QQa&YDFQUJPOTa)BOEMFS
    ຊདྷ͸਌ΫϥεͰॲཧ͞Ε͍͕ͯͨɺ
    SFOEFSϝιου಺Ͱ3FTQPOTBCMFΛ

    ॲཧ͢ΔͨΊʹඞཁ

    View full-size slide

  78. ΤϥʔϨεϙϯεͷڞ௨Խ


    "QQa&YDFQUJPOTa)BOEMFS
    3FTQPOTBCMFҎ֎͸ࢦఆͷϨεϙϯεΛฦ͢

    View full-size slide

  79. ·ͩ·ͩ՝୊͸͋Δ
    w ࠓ೔঺հͨ͠ͷ͸࠷௿ݶͷҰྫ
    w ೝূ࣌ͷΤϥʔɺΞϓϦέʔγϣϯಛ༗Τϥʔɺ)551ܥ
    ϨεϙϯεΤϥʔͳͲରԠ΋ඞཁ


    View full-size slide

  80. ৄ͘͠͸2JJUBʹ·ͱΊ·ͨ͠


    refs: https://qiita.com/hypermkt/items/78e878bb38cc63e40b2b

    View full-size slide

  81. ࿩͢͜ͱ
    w എܠͱ໨త
    w ϞόΠϧ"1*։ൃͰࢲୡ͕৐Γӽ͑ͨน
    w ࣮ݱٕज़ͷબ୒
    w "1*ઃܭ
    w ಡॻձʹΑΔڞ௨஌ࣝͷཱ֬
    w 3&45GVM"1*ઃܭ
    w "1*ઃܭͰͷࣦഊɾɾɾ
    w -BSBWFM"1*ೝূͷ࣮૷
    w ͦ΋ͦ΋0"VUIʹ͍ͭͯ
    w -BSBWFMʹ͓͚Δ0"VUIͷ࣮ݱํ๏
    w Τϥʔ࣌ͷ"1*Ϩεϙϯεઃܭ
    w ·ͱΊ

    View full-size slide

  82. ·ͱΊ
    w ৽ن։ൃ࣌͸બ୒ͷ࿈ଓɻཁ݅ɾকདྷੑɾܧଓతͳӡ༻ͳͲ

    ༷ʑͳࢹ఺Ͱͷݕ౼Λܾͯ͠ΊΔɻ
    w ϚχϡΞϧʹͳ͚Ε͹ίʔυΛಡΉɻ
    w ϞόΠϧΞϓϦ։ൃ࣌͸"1*ɾϞόΠϧΞϓϦΤϯδχΞͱͷ

    ૬ޓཧղɾڞ௨ೝࣝͱίϛϡχέʔγϣϯ͕ඞཁɻ
    w ΞϓϦͷಛੑΛཧղͯ͠ΞϓϦΤϯδχΞͱڠྗͯ͠։ൃ͕ඞཁɻ


    View full-size slide

  83. ࠷৽ͷ࠾༻৘ใΛνΣοΫˠ !QC@SFDSVJU

    View full-size slide