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
Create a Laravel notification via Slack when ba...
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
arm4
March 02, 2019
Programming
860
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Create a Laravel notification via Slack when batch jobs are finished
arm4
March 02, 2019
More Decks by arm4
See All by arm4
Google Data Studio 101
fromarm4
0
180
5 Points Of Customizing Vuetify
fromarm4
4
1.4k
about abstract component design using slots of Vue.js
fromarm4
4
1.5k
laravel_lt_party_with_mokumoku_3
fromarm4
0
420
Make it happen in realtime with Laravel Echo and Pusher
fromarm4
0
1k
Trying to write a code with Laravel+Vue+TypeScript
fromarm4
0
590
solving frontend issues
fromarm4
1
1.8k
Popular Vue.js UI Frameworks in 2019
fromarm4
2
890
SKDs対象のWeb API設計概論〜Laravelを添えて〜
fromarm4
0
1.4k
Other Decks in Programming
See All in Programming
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
160
RTSPクライアントを自作してみた話
simotin13
0
610
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
550
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
140
Webフレームワークの ベンチマークについて
yusukebe
0
170
さぁV100、メモリをお食べ・・・
nilpe
0
150
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
150
依存関係から依存物へ―Dependencyという言葉の歴史をひも解く
j_lee
0
120
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
170
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
200
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
4
1.4k
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
360
Featured
See All Featured
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
410
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
The Language of Interfaces
destraynor
162
27k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
620
Color Theory Basics | Prateek | Gurzu
gurzu
0
370
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
A better future with KSS
kneath
240
18k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
71
40k
The World Runs on Bad Software
bkeepers
PRO
72
12k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
260
Rails Girls Zürich Keynote
gr2m
96
14k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
630
Transcript
Laravelの バッチ処理終了を Slackでお知らせ する @plumsa
自己紹介 株式会社プラムザ Tech Lead ハトヨウコ 公式Twitter ララ・ベル子さんの中の人 @plumsa 2
動機 関連するテーブルが 22個もある テストデータをしょっちゅう生成する 3
Seeder流して 他の作業しよう〜 4
5 20分ほどかかるの で、ほっとくと うっかり忘れてしまう。
“ そうだ! Slackで通知されたらいいね 6
開発環境 ◦ Laravel 5.7.20 ◦ PHP 7.2.7 7
手順 ◦ Guzzleをインストール composer require guzzlehttp/guzzle ※Laravel 5.8の場合 composer require
laravel/slack-notification-channel ◦ Notificationクラスの作成 php artisan make:notification SlackPosted ◦ Notificationクラス(SlackPosted)の実装 ◦ Slack通知サービスクラスを作成&実装 ◦ Seederを作成&実装 php artisan make:seeder SampleSeeder 8
Notificationクラス(SlackPosted)の実装 9 Slackに通知をする汎用的なNotificationクラスを 実装する。
Slack通知サービスクラスを作成&実装 10 Seeder通知サービスクラス (SlackSeederNotificationService)を実装する
Seederを作成&実装 11 Seeder通知サービスクラスにSeeder名を渡して 完了の通知を送ってもらう。
できた! 12
Thanks! ご清聴ありがとうございました! 13