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
770
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
390
Make it happen in realtime with Laravel Echo and Pusher
fromarm4
0
980
Trying to write a code with Laravel+Vue+TypeScript
fromarm4
0
530
solving frontend issues
fromarm4
1
1.6k
Popular Vue.js UI Frameworks in 2019
fromarm4
2
870
SKDs対象のWeb API設計概論〜Laravelを添えて〜
fromarm4
0
1.3k
Other Decks in Programming
See All in Programming
Claude Code で Astro blog を Pages から Workers へ移行してみた
codehex
0
170
Streamlitで実現できるようになったこと、実現してくれたこと
ayumu_yamaguchi
2
260
Vibe coding コードレビュー
kinopeee
0
380
なぜあなたのオブザーバビリティ導入は頓挫するのか
ryota_hnk
4
550
構文解析器入門
ydah
7
2k
Reactの歴史を振り返る
tutinoko
1
160
코딩 에이전트 체크리스트: Claude Code ver.
nacyot
0
1k
Git Sync を超える!OSS で実現する CDK Pull 型デプロイ / Deploying CDK with PipeCD in Pull-style
tkikuc
4
490
Advanced Micro Frontends: Multi Version/ Framework Scenarios
manfredsteyer
PRO
0
130
AIのメモリー
watany
12
1.2k
11年かかって やっとVibe Codingに 時代が追いつきましたね
yimajo
1
230
React は次の10年を生き残れるか:3つのトレンドから考える
oukayuka
41
16k
Featured
See All Featured
How to Ace a Technical Interview
jacobian
278
23k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
6k
How GitHub (no longer) Works
holman
314
140k
Why You Should Never Use an ORM
jnunemaker
PRO
58
9.5k
Rebuilding a faster, lazier Slack
samanthasiow
83
9.1k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
182
54k
Become a Pro
speakerdeck
PRO
29
5.5k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
The World Runs on Bad Software
bkeepers
PRO
70
11k
The Straight Up "How To Draw Better" Workshop
denniskardys
235
140k
How STYLIGHT went responsive
nonsquared
100
5.7k
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