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
arm4
March 02, 2019
Programming
0
730
Create a Laravel notification via Slack when batch jobs are finished
arm4
March 02, 2019
Tweet
Share
More Decks by arm4
See All by arm4
Google Data Studio 101
fromarm4
0
120
5 Points Of Customizing Vuetify
fromarm4
4
1.2k
about abstract component design using slots of Vue.js
fromarm4
4
1.4k
laravel_lt_party_with_mokumoku_3
fromarm4
0
370
Make it happen in realtime with Laravel Echo and Pusher
fromarm4
0
960
Trying to write a code with Laravel+Vue+TypeScript
fromarm4
0
500
solving frontend issues
fromarm4
1
1.6k
Popular Vue.js UI Frameworks in 2019
fromarm4
2
850
SKDs対象のWeb API設計概論〜Laravelを添えて〜
fromarm4
0
1.2k
Other Decks in Programming
See All in Programming
[Fin-JAWS 第38回 ~re:Invent 2024 金融re:Cap~]FaultInjectionServiceアップデート@pre:Invent2024
shintaro_fukatsu
0
400
時計仕掛けのCompose
mkeeda
1
280
Spring gRPC について / About Spring gRPC
mackey0225
0
220
Grafana Loki によるサーバログのコスト削減
mot_techtalk
1
110
DevinとCursorから学ぶAIエージェントメモリーの設計とMoatの考え方
itarutomy
1
640
バックエンドのためのアプリ内課金入門 (サブスク編)
qnighy
8
1.7k
“あなた” の開発を支援する AI エージェント Bedrock Engineer / introducing-bedrock-engineer
gawa
11
1.8k
ペアーズでの、Langfuseを中心とした評価ドリブンなリリースサイクルのご紹介
fukubaka0825
2
300
Lottieアニメーションをカスタマイズしてみた
tahia910
0
120
chibiccをCILに移植した結果 (NGK2025S版)
kekyo
PRO
0
210
CloudNativePGがCNCF Sandboxプロジェクトになったぞ! 〜CloudNativePGの仕組みの紹介〜
nnaka2992
0
220
定理証明プラットフォーム lapisla.net
abap34
1
1.7k
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.2k
Optimizing for Happiness
mojombo
376
70k
Done Done
chrislema
182
16k
Music & Morning Musume
bryan
46
6.3k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
A Philosophy of Restraint
colly
203
16k
Code Reviewing Like a Champion
maltzj
521
39k
Practical Orchestrator
shlominoach
186
10k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
10
1.3k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
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