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 batch jobs are finished
Search
arm4
March 02, 2019
Programming
0
600
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
97
5 Points Of Customizing Vuetify
fromarm4
4
1.1k
about abstract component design using slots of Vue.js
fromarm4
4
1.2k
laravel_lt_party_with_mokumoku_3
fromarm4
0
290
Make it happen in realtime with Laravel Echo and Pusher
fromarm4
0
900
Trying to write a code with Laravel+Vue+TypeScript
fromarm4
0
420
solving frontend issues
fromarm4
1
1.4k
Popular Vue.js UI Frameworks in 2019
fromarm4
2
790
SKDs対象のWeb API設計概論〜Laravelを添えて〜
fromarm4
0
1.1k
Other Decks in Programming
See All in Programming
効率化に挑戦してみたらモバイル開発が少し快適になった話
ryunakayama
0
110
VSCodeでのDatabricks開発もお勧めしたい/I would also recommend Databricks development with VSCode.
kazumain
0
240
コードレビューで学ぶ!Kotlinオブジェクト指向デザインパターン
akkie76
2
180
Folding Cheat Sheet #1
philipschwarz
PRO
0
210
0→1と1→10の狭間で Javaという技術選定を振り返る/Reflecting on the Decision to Choose Java Between Scaling from 0 to 1 and 1 to 10
jaguar_imo
2
370
PHP8.3の機能を振り返る / Review of PHP 8.3 features
seike460
PRO
1
110
SwiftUIで使いやすいToastの作り方 / How to build a Toast system which is easy to use in SwiftUI
lovee
3
110
Blue/Greenデプロイの導入による 運用フローの改善
kudoas
1
360
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
350
Behind VS Code Extensions for JavaScript / TypeScript Linnting and Formatting
unvalley
4
310
今の SmartHR にエンジニアで入社するとどうなるの?
daisukeshinoku
5
4.6k
甘い香りに誘われてVanilla Extractを1年間運用してみた
miyahkun
1
110
Featured
See All Featured
Web development in the modern age
philhawksworth
202
10k
GitHub's CSS Performance
jonrohan
1023
450k
RailsConf 2023
tenderlove
2
530
Rebuilding a faster, lazier Slack
samanthasiow
72
8.2k
Making Projects Easy
brettharned
108
5.5k
Mobile First: as difficult as doing things right
swwweet
216
8.6k
Being A Developer After 40
akosma
56
580k
10 Git Anti Patterns You Should be Aware of
lemiorhan
646
58k
A designer walks into a library…
pauljervisheath
199
23k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
220
21k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
24
2.3k
Fashionably flexible responsive web design (full day workshop)
malarkey
397
65k
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