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
Laravel_Slack通知で実践した_リアルタイムエラー共有開発
Search
kumamon_engineer
May 22, 2019
Technology
2
1.4k
Laravel_Slack通知で実践した_リアルタイムエラー共有開発
kumamon_engineer
May 22, 2019
Tweet
Share
More Decks by kumamon_engineer
See All by kumamon_engineer
失敗から学ぶNuxt.jsプロジェクトでの作り込み事例
miyakeylab
0
76
Other Decks in Technology
See All in Technology
TSのコードをRustで書き直した話
askua
2
160
re:Invent2024 KeynoteのAmazon Q Developer考察
yusukeshimizu
1
150
メンバーがオーナーシップを発揮しやすいチームづくり
ham0215
2
140
Evolving Architecture
rainerhahnekamp
3
260
Docker Desktop で Docker を始めよう
zembutsu
PRO
0
170
comilioとCloudflare、そして未来へと向けて
oliver_diary
6
450
EMConf JP の楽しみ方 / How to enjoy EMConf JP
pauli
2
150
re:Invent 2024のふりかえり
beli68
0
110
あなたの人生も変わるかも?AWS認定2つで始まったウソみたいな話
iwamot
3
860
Bring Your Own Container: When Containers Turn the Key to EDR Bypass/byoc-avtokyo2024
tkmru
0
860
dbtを中心にして組織のアジリティとガバナンスのトレードオンを考えてみた
gappy50
0
280
Oracle Base Database Service:サービス概要のご紹介
oracle4engineer
PRO
1
16k
Featured
See All Featured
Practical Orchestrator
shlominoach
186
10k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3.1k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
Git: the NoSQL Database
bkeepers
PRO
427
64k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Thoughts on Productivity
jonyablonski
68
4.4k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.2k
Code Reviewing Like a Champion
maltzj
521
39k
Side Projects
sachag
452
42k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
960
Designing Dashboards & Data Visualisations in Web Apps
destraynor
230
52k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
Transcript
Laravel+Slack௨Ͱ࣮ફͨ͠ ϦΞϧλΠϜΤϥʔڞ༗։ൃ Laravel Meetup Tokyo Vol.12 2019/05/22 Miyake Yusuke
ࣗݾհ ͘·ϞϯΤϯδχΞ (@miyakey7) ॴଐ ɹגࣜձࣾITϓϩύʔτφʔζ ϝϞ ɹɾ࣮Ո͘·Ϟϯγϣοϓ ɹɾڈɺWEBΤϯδχΞʹస৬ ɹɾLaravelJPConferance2019͓ख͍͠·ͨ͠
ϑϦʔϥϯεɺىۀՈࢧԉαʔϏεʮITϓϩύʔτφʔζʯ ίʔυڞ༗αʔϏε ʮReviewMeʯ ͘͘ձʮProLaboʯ
1ਓͰ։ൃ͍ͯͨ͠ ϓϩδΣΫτʹΤϯδχΞ͕ 2ਓδϣΠϯͨ͠
WEBΤϯδχΞͱͯ͠ ॳͷνʔϜ։ൃ
νʔϜ։ൃΛ ׆͔͢औΓΈͳ͍͔
ϖΞϓϩʁϞϒϓϩʁ ϥΠϒίʔσΟϯάʁ ։ൃ߹॓ʁ
ΤϥʔΛڞ༗ͯ͠ ΈΜͳͰղܾ͢ΔΈ͕ ཉ͍͠
ΤϥʔΛڞ༗͍ͨ͠ཧ༝ ᶃΤϥʔʹର͢Δ ɹࣗͷݟͷڞ༗ ᶄ࣭͕ۤखͳ ɹ৽ਓΤϯδχΞͷҭ
Τϥʔڞ༗ͷΈΛߟ͑ͨ APIαʔόʔ ಉҰwebhookΛར༻ ϝοηʔδʹϘλϯ ΞΫγϣϯΛ͚͓ͯ͘ POST ϘλϯΞΫγϣϯ ͷԠΛฦ͢
Slack௨ͷ࣮ʹ͍ͭͯ ؆୯ʹग़དྷΔSlack௨࣮खஈେମ3ͭ ᶃLog௨ ᶄNotificationΫϥε(Guzzle) ᶅhttpClientϥΠϒϥϦ(Guzzle)
ᶃLog௨Ͱ࣮
؆୯ʹग़·͢ʂ
Τϥʔϩάtraceશ෦ग़ΔͷͰ ͪΐͬͱՄࢹੑ͕Լ͕Δ
ᶄNotificationΫϥεͰ࣮ v5.7.14 Ҏ͔߱Ͳ͏͔Ͱ ࣮ͷ४උํ๏͕มΘΓ·͢ʂ SlackMessage.phpͳͲͷ ϑΝΠϧ͕֎෦ͷ ύοέʔδʹग़͞Ε͍ͯ ·͢ʂ
v5.7.14ະຬ v5.7.14Ҏ߱
Կ͔͠ΒͷΫϥεʹ ɾNotifiableΛuse ɾrouteNotificationForSlackͰɹ SlackͷwebhookͷURLΛ͢ ɾnotifyΛίʔϧ͢Δ
֎෦ύοέʔδʹͳ͔ͬͯΒɺ SlackMessageΫϥεͰ ϘλϯΞΫγϣϯ༻ͷઃఆ͕༻ҙ ͞Ε͍ͯΔ ͨͩ͠ϘλϯΫϦοΫ࣌ʹ༻ҙ͞ Ε͍ͯΔΞΫγϣϯURLʹඈͿ ͚ͩ
ᶅhttpClientϥΠϒϥϦ ݁ہɺSlackͷAPIػೳΛ ৭ʑ͏ͳΒࣗͰ ϑΥʔϚοτॻ͍ͨํ͕ ૣ͍
Slack͔ΒͷPOSTΛड͚͚Δํ๏ Request URLͷ෦ʹΤϯυϙΠϯτΛઃఆ →͜ΕʹΑΓϘλϯԡԼ࣌ʹPOST͕௨͞ΕΔ
Slack͔ΒͷPOSTΛड͚͚Δํ๏ APIΤϯυϙΠϯτͷURLɺCSRFτʔΫϯνΣοΫΛ֎͢
Slack͔ΒͷPOSTΛड͚͚Δํ๏ ݩͷSlackϝοηʔδʹɺϘλϯԡԼͨ͠ਓͷ໊લΛͯ͠ ԠΛฦ͢ॲཧ
ϦΞϧλΠϜΤϥʔڞ༗௨ ɾΤϥʔ༰࠷খݶͷ༰ ɾHelpܥͷϘλϯΛ͚ͯ୭͕ԡ͔͔ͨ͠ΔΑ͏ʹ
ϦΞϧλΠϜΤϥʔڞ༗։ൃ ϧʔϧ̏ͭ ᶃڞ༗͢ΔͷErrorϨϕϧͷϩά ᶄৗʹchannelϝϯγϣϯ(νʔϜͰܾΊΔ) ᶅಗ໊Ͱ௨ʹ͓ͯ͘͠
͓લͷΤϥʔԶͷͷ ԶͷΤϥʔԶͷͷ
ݙతͳΤϥʔڞ༗͢ΔͨΊʹ • հࡏ͗͢͠ͳ͍Α͏ʹҙ • جຊεϧʔ͢Δ৺࣋ͪ • ಉ͡Τϥʔ͕࿈ଓͯͨ͠Βฉ͍ͯΈΔ
։ൃνʔϜͷ ີ݁߹ྑ͘ͳ͍ʁ
ϦΞϧλΠϜΤϥʔڞ༗։ൃͷ ϝϦοτɾσϝϦοτ ϝϦοτ • ΤϥʔͰϋϚΔϦεΫ͕ݮΔ • தʹؤுͬͯΔͷ͕֞ؒݟ͑Δ σϝϦοτ • ूதྗͷܽ
• 10ਓҎ্ͷνʔϜͰݫ͍͠
ϦΞϧλΠϜΤϥʔڞ༗։ൃ ͷ࠷େͷϝϦοτ νʔϜશһ͕ಉ͡ͷ ܦݧ(Τϥʔ)ΛΓӽ͑Δ
࠷ޙʹ…
LARACON US 2019 ߦ͖ͬͯ·͢ʂ
ΞϑλʔύʔςΟձ͕ͦ͏