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

LaravelのQuery Scopesについて #fukuokaphp

akase244
August 08, 2018

LaravelのQuery Scopesについて #fukuokaphp

Fukuoka.php Vol.26 の発表資料です。
https://fukuokaphp.connpass.com/event/95672/

akase244

August 08, 2018
Tweet

More Decks by akase244

Other Decks in Programming

Transcript

  1. www.innovator.jp.net 'VLVPLBQIQ7PM  ΞδΣϯμ • ࣗݾ঺հ • ࠓճ࣮ݱ͍ͨ͠಺༰ • 4PGU%FMFUJOH

    • .PEFMΫϥεͷOFX2VFSZϝιουΛΦʔόʔϥΠυ • 2VFSZ4DPQFT • ࣮ࡍͷۀ຿ͷϓϩμΫγϣϯίʔυΛղઆ • ·ͱΊ  
  2. www.innovator.jp.net 'VLVPLBQIQ7PM  4PGU%FMFUJOH • -BSBWFMͷ࿦ཧ࡟আػೳ͸ඪ४Ͱ࣮૷͞Ε͍ͯΔɻ • IUUQTMBSBWFMDPNEPDTFMPRVFOUEFMFUJOHNPEFMT • ʮ4PGU%FMFUJOHʯͱͯ͠આ໌͞Ε͍ͯΔɻ

    • ʮEFMFUFE@BUʯΛΧϥϜͱͯ͠௥Ճɻ • ϞσϧʹҎԼͷهड़Λ௥Ճɻ • VTF*MMVNJOBUFa%BUBCBTFa&MPRVFOUa4PGU%FMFUFT • VTF4PGU%FMFUFT • QSPUFDUFEEBUFT<bEFMFUFE@BU>  
  3. www.innovator.jp.net 'VLVPLBQIQ7PM  4PGU%FMFUJOH • ҎԼͷػೳʹ͍ͭͯ͸υΩϡϝϯτΛࢀরͯ͠Έ͍ͯͩ͘͞ɻ • ࿦ཧ࡟আࡁΈͷϨίʔυ͔Λ൑ఆ͢Δํ๏ USBTIFE 

    • ࿦ཧ࡟আࡁΈͷϨίʔυ΋ؚΊͯநग़͢Δํ๏ XJUI5SBTIFE  • ࿦ཧ࡟আࡁΈͷϨίʔυͷΈΛநग़͢Δํ๏ POMZ5SBTIFE  • ࿦ཧ࡟আࡁΈͷϨίʔυΛ෮ݩ͢Δํ๏ SFTUPSF  • ෺ཧ࡟আ͢Δํ๏ GPSDF%FMFUF  
  4. www.innovator.jp.net 'VLVPLBQIQ7PM  2VFSZ4DPQFT • (MPCBM4DPQFTػೳͷઆ໌ • (MPCBM4DPQFTΛར༻͢ΔͱϞσϧͷ͢΂ͯͷΫΤϦʔʹ੍໿Λద ༻Ͱ͖·͢ɻ •

    TPGUEFMFUFػೳ͸ɺ(MPCBM4DPQFTΛར༻ͯ͠Ϟσϧ͔Β࡟আ͞Ε ͍ͯͳ͍σʔλͷநग़Λߦ͍ͬͯ·͢ɻͱͷهड़͋Γɻ  
  5. www.innovator.jp.net 'VLVPLBQIQ7PM  ·ͱΊ • ϞσϧΛݺͼग़ͨ͠ࡍʹݻఆͷ৚݅ͰߜΓࠐ·Εͨঢ়ଶʹ͢Δʹ͸ʁ • 4PGU%FMFUJOH͸࿦ཧ࡟আͱͯ͠ͷػೳ͸ඞཁे෼͕ͩநग़৚͕݅มߋͰ ͖ͳ͍ͷͰࠓճͷέʔεͰ͸ෆՄɻ •

    OFX2VFSZϝιουͷΦʔόʔϥΠυͰ࣮ݱՄೳɻ • ஫ҙͯ͠ΦʔόʔϥΠυ͠ͳ͍ͱطଘػೳʹӨڹΛ༩͑ͯ͠·͏ɻ • ϞσϧΛܧঝ͢Δͱҙਤͨ͠நग़݁ՌʹͳΒͳ͍ɻ • ৗʹநग़৚͕݅ద༻͞ΕΔͨΊɺநग़৚݅ΛղআͰ͖ͳ͍ɻ • 2VFSZ4DPQFTͷ(MPCBM4DPQFTΛར༻͢Δ͜ͱͰ࣮ݱՄೳɻ • ϞσϧΛܧঝͯ͠நग़৚݅Λ৔߹෼͚͢Δ͜ͱ͕Մೳɻ • நग़৚݅Λղআ͢Δ͜ͱ΋Մೳɻ