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
800
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
150
5 Points Of Customizing Vuetify
fromarm4
4
1.3k
about abstract component design using slots of Vue.js
fromarm4
4
1.5k
laravel_lt_party_with_mokumoku_3
fromarm4
0
400
Make it happen in realtime with Laravel Echo and Pusher
fromarm4
0
990
Trying to write a code with Laravel+Vue+TypeScript
fromarm4
0
540
solving frontend issues
fromarm4
1
1.7k
Popular Vue.js UI Frameworks in 2019
fromarm4
2
870
SKDs対象のWeb API設計概論〜Laravelを添えて〜
fromarm4
0
1.4k
Other Decks in Programming
See All in Programming
Register is more than clipboard
satorunooshie
1
460
KoogではじめるAIエージェント開発
hiroaki404
1
430
flutter_kaigi_2025.pdf
kyoheig3
1
210
なぜ強調表示できず ** が表示されるのか — Perlで始まったMarkdownの歴史と日本語文書における課題
kwahiro
9
5.1k
レイトレZ世代に捧ぐ、今からレイトレを始めるための小径
ichi_raven
0
190
ボトムアップの生成AI活用を推進する社内AIエージェント開発
aku11i
0
1.6k
The Missing Link in Angular's Signal Story: Resource API and httpResource
manfredsteyer
PRO
0
110
歴史から学ぶ「Why PHP?」 PHPを書く理由を改めて理解する / Learning from History: “Why PHP?” Rediscovering the Reasons for Writing PHP
seike460
PRO
0
140
ノーコードからの脱出 -地獄のデスロード- / Escape from Base44
keisuke69
0
680
業務でAIを使いたい話
hnw
0
260
CSC509 Lecture 11
javiergs
PRO
0
300
Kotlinで実装するCPU/GPU 「協調的」パフォーマンス管理
matuyuhi
0
370
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
331
21k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
34
2.3k
Done Done
chrislema
186
16k
Building Adaptive Systems
keathley
44
2.8k
Side Projects
sachag
455
43k
Automating Front-end Workflow
addyosmani
1371
200k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
For a Future-Friendly Web
brad_frost
180
10k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.7k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
GraphQLとの向き合い方2022年版
quramy
49
14k
Rails Girls Zürich Keynote
gr2m
95
14k
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