Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
1k
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
880
SKDs対象のWeb API設計概論〜Laravelを添えて〜
fromarm4
0
1.4k
Other Decks in Programming
See All in Programming
TUIライブラリつくってみた / i-just-make-TUI-library
kazto
1
190
ID管理機能開発の裏側 高速にSaaS連携を実現したチームのAI活用編
atzzcokek
0
120
How Software Deployment tools have changed in the past 20 years
geshan
0
25k
[堅牢.py #1] テストを書かない研究者に送る、最初にテストを書く実験コード入門 / Let's start your ML project by writing tests
shunk031
11
6.3k
生成AIを活用したリファクタリング実践 ~コードスメルをなくすためのアプローチ
raedion
0
170
「文字列→日付」の落とし穴 〜Ruby Date.parseの意外な挙動〜
sg4k0
0
330
GeistFabrik and AI-augmented software development
adewale
PRO
0
220
MAP, Jigsaw, Code Golf 振り返り会 by 関東Kaggler会|Jigsaw 15th Solution
hasibirok0
0
180
競馬で学ぶ機械学習の基本と実践 / Machine Learning with Horse Racing
shoheimitani
14
14k
AIと協働し、イベントソーシングとアクターモデルで作る後悔しないアーキテクチャ Regret-Free Architecture with AI, Event Sourcing, and Actors
tomohisa
5
13k
チーム開発の “地ならし"
konifar
8
6.4k
データファイルをAWSのDWHサービスに格納する / 20251115jawsug-tochigi
kasacchiful
2
100
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
697
190k
Thoughts on Productivity
jonyablonski
73
4.9k
BBQ
matthewcrist
89
9.9k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
GitHub's CSS Performance
jonrohan
1032
470k
Being A Developer After 40
akosma
91
590k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
54k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
How GitHub (no longer) Works
holman
316
140k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
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