{"id":264,"date":"2018-02-11T03:20:53","date_gmt":"2018-02-10T18:20:53","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=264"},"modified":"2018-02-11T03:25:16","modified_gmt":"2018-02-10T18:25:16","slug":"laravel5-6%e3%81%ae%e6%96%b0%e6%a9%9f%e8%83%bd%e3%81%a7%e3%82%a8%e3%83%a9%e3%83%bc%e3%82%92slack%e3%81%ab%e9%80%81%e4%bf%a1","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=264","title":{"rendered":"Laravel5.6\u306e\u65b0\u6a5f\u80fd\u3067\u30a8\u30e9\u30fc\u3092slack\u306b\u9001\u4fe1"},"content":{"rendered":"<p>\u6570\u65e5\u524d\u3001Laravel5.6\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u305f\u306e\u3067\u3001<strong>\u65b0\u6a5f\u80fd\u306e\u30ed\u30b0\uff08\u30a8\u30e9\u30fc\uff09\u3092slack\u306b\u9001\u4fe1\u3059\u308b\u3068\u3044\u3046\u6a5f\u80fd<\/strong>\u3092\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u306e\u6a5f\u80fd\u3092\u4f7f\u3048\u3070\u3001\u516c\u958b\u3057\u305f\u30b5\u30a4\u30c8\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3089\u3001slack\u3067\u901a\u77e5\u3092\u53d7\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u306e\u4e0d\u5177\u5408\u60c5\u5831\u3092\u5f85\u305f\u306a\u304f\u3068\u3082\u4fee\u6b63\u3059\u3079\u304d\u7b87\u6240\u3092\u77e5\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3093\u3067\u3001\u30b5\u30a4\u30c8\u904b\u55b6\u306b\u306f\u91cd\u5b9d\u3057\u305d\u3046\u3067\u3059\u306d\u3002<\/p>\n<p>\u3067\u306f\u3001\u624b\u9806\u3092\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>\uff11\uff0eslack\u306e\u30a6\u30a7\u30d6\u30d5\u30c3\u30af\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u30a8\u30e9\u30fc\u30ed\u30b0\u3092slack\u306b\u9001\u4fe1\u3059\u308b\u305f\u3081\u306b\u306f<strong>\u3001WebHook\uff08\u30a6\u30a7\u30d6\u30d5\u30c3\u30af\uff09<\/strong>\u3068\u547c\u3070\u308c\u308b\u6295\u7a3f\u7528URL\u3092\u53d6\u5f97\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30ea\u30f3\u30af\u304b\u3089\u53d6\u5f97\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><a href=\"https:\/\/slack.com\/apps\/A0F7XDUAZ-incoming-webhooks\" target=\"_blank\" rel=\"noopener\">Incoming WebHooks<\/a><\/p>\n<p>\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3089\u3001<strong>Add Configuration<\/strong>\u3092\u30af\u30ea\u30c3\u30af\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-268\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/02\/slack_1.png\" alt=\"\" width=\"728\" height=\"475\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/02\/slack_1.png 728w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/02\/slack_1-300x196.png 300w\" sizes=\"auto, (max-width: 728px) 100vw, 728px\" \/><\/p>\n<p>\u6295\u7a3f\u3057\u305f\u3044\u30c1\u30e3\u30f3\u30cd\u30eb\u3092\u9078\u629e\u3057\u3001<strong>Add Incoming WebHooks intragration<\/strong>\u3092\u30af\u30ea\u30c3\u30af\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-267\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/02\/slack_2.png\" alt=\"\" width=\"947\" height=\"259\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/02\/slack_2.png 947w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/02\/slack_2-300x82.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/02\/slack_2-768x210.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<p>\u30a6\u30a7\u30d6\u30d5\u30c3\u30afURL\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u3053\u308c\u3092\u30b3\u30d4\u30fc\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-266\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/02\/slack_3.png\" alt=\"\" width=\"984\" height=\"214\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/02\/slack_3.png 984w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/02\/slack_3-300x65.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/02\/slack_3-768x167.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<h2>\uff12\uff0e\u30a6\u30a7\u30d6\u30d5\u30c3\u30afURL\u3092\u66f8\u304d\u8fbc\u3080<\/h2>\n<p>Laravel\u306e<strong>.env<\/strong>\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<pre>LOG_CHANNEL=<strong>slack<\/strong>\r\n<strong>LOG_SLACK_WEBHOOK_URL=https:\/\/hooks.slack.com\/services\/*******\/*******\/**************<\/strong><\/pre>\n<p>\u203b\u6ce8\uff1a \u4eca\u56de\u306f\u8aac\u660e\u306e\u305f\u3081\u3001LOG_CHANNEL\u3082<strong>stack<\/strong>\u304b\u3089<strong>slack<\/strong>\u306b\u5909\u66f4\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\uff13\uff0elogging.php\u3067\u8a2d\u5b9a<\/h2>\n<p>slack\u3078\u306e\u30c6\u30b9\u30c8\u6295\u7a3f\u3092\u697d\u306b\u3059\u308b\u305f\u3081\u306b\u3001<strong>\/config\/logging.php<\/strong>\u3067slack\u306e\u30a8\u30e9\u30fc\u30ec\u30d9\u30eb\u3092\u4e0b\u3052\u307e\u3059\u3002<\/p>\n<pre>'slack' =&gt; [\r\n    'driver' =&gt; 'slack',\r\n    'url' =&gt; env('LOG_SLACK_WEBHOOK_URL'),\r\n    'username' =&gt; 'Laravel Log',\r\n    'emoji' =&gt; ':boom:',\r\n    'level' =&gt; '<strong>debug<\/strong>',\r\n],<\/pre>\n<p>\u203b\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f<strong>emergency<\/strong>\u3067\u3059\u3002<\/p>\n<h2>\uff14\uff0e\u30c6\u30b9\u30c8\u306e\u30a8\u30e9\u30fc\u9001\u4fe1<\/h2>\n<p>\u3055\u3041\u3001\u3053\u308c\u3067\u6e96\u5099\u306f\u6574\u3044\u307e\u3057\u305f\u3002<br \/>\n\u7121\u7406\u3084\u308a\u30a8\u30e9\u30fc\u3092\u767a\u751f\u3055\u305b\u3066slack\u3078\u30ed\u30b0\u3092\u30c6\u30b9\u30c8\u6295\u7a3f\u3055\u305b\u3066\u307f\u307e\u3057\u3087\u3046\uff01<\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse Illuminate\\Http\\Request;\r\n\r\nclass HomeController extends Controller\r\n{\r\n    public function logging_slack() {\r\n\r\n        <strong>\\Log::notice('slack\u306b\u30c6\u30b9\u30c8\u901a\u77e5\uff01');<\/strong>\r\n        <strong>echo $test; \/\/ \u5909\u6570\u3092\u5ba3\u8a00\u3057\u3066\u306a\u3044\u3093\u3067\u3001\u3053\u3053\u3067\u30a8\u30e9\u30fc\u767a\u751f<\/strong>\r\n\r\n    }\r\n}<\/pre>\n<p>\u307e\u305a\u3001<strong>Log::notice();<\/strong>\u306e\u90e8\u5206\u306f\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u6700\u4f4e\u30ec\u30d9\u30eb\u3067\u3059\u3002<br \/>\n\u4ed6\u306b\u3082\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u304c\u3042\u308b\u306e\u3067\u3001\u3069\u306e\u7a0b\u5ea6\u306e\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3089\u901a\u77e5\u3092\u3057\u305f\u3044\u304b\u3092\u81ea\u7531\u306b\u6c7a\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>Log::emergency($message);\r\nLog::alert($message);\r\nLog::critical($message);\r\nLog::error($message);\r\nLog::warning($message);\r\nLog::notice($message);\r\nLog::info($message);\r\nLog::debug($message);<\/pre>\n<p>\u305d\u3057\u3066\u3001\u30c6\u30b9\u30c8\u5b9f\u884c\u3057\u305f\u3089\u3053\u306e\u3088\u3046\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u304cslack\u306b\u6295\u7a3f\u3055\u308c\u307e\u3059\u3088\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-274\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/02\/slack_4-1.png\" alt=\"\" width=\"715\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/02\/slack_4-1.png 715w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/02\/slack_4-1-300x134.png 300w\" sizes=\"auto, (max-width: 715px) 100vw, 715px\" \/><\/p>\n<p>\u4ee5\u4e0a\u3067\u3059\u3002<br \/>\n\u3042\u3068\u306f\u304a\u597d\u307f\u306e\u8a2d\u5b9a\u3067\u3088\u308a\u3088\u3044\u30b5\u30a4\u30c8\u904b\u55b6\u3092\u884c\u3063\u3066\u4e0b\u3055\u3044\uff01\uff08\u672c\u5bb6\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306f<a href=\"https:\/\/laravel.com\/docs\/5.6\/logging\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089<\/a>\uff09<\/p>\n<p>\u3066\u304b\u3001\u3053\u3046\u3044\u3046\u6a5f\u80fd\u304c\u642d\u8f09\u3055\u308c\u305f\u308a\u3059\u308b\u3068\u3001\u958b\u767a\u8005\u3068\u3057\u3066slack\u306b\u672c\u683c\u7684\u306b\u79fb\u884c\u3057\u305f\u307b\u3046\u304c\u3044\u3044\u306e\u304b\u306a\u30fc\u3001\u3068\u8003\u3048\u305f\u308a\u3082\u3057\u307e\u3059\u306d\u3002<br \/>\nslack\u304c\u65e5\u672c\u8a9e\u5316\u3057\u305f\u3068\u3044\u3046\u30cb\u30e5\u30fc\u30b9\u304c\u3042\u308a\u307e\u3057\u305f\u3057\u3001\u5f53\u6642\u306e\u30d5\u30a7\u30a4\u30b9\u30d6\u30c3\u30af\u306e\u3088\u3046\u306b\u4ed6\u306e\u56fd\u7523\u30b5\u30a4\u30c8\u3092\u99c6\u9010\u3057\u3066\u3044\u304f\u53ef\u80fd\u6027\u3082\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb\u3002<\/p>\n<h2>\u3061\u306a\u307f\u306b<\/h2>\n<p>\u4eca\u56de\u521d\u3081\u3066Laravel 5.6\u3092\u89e6\u3063\u3066\u307f\u305f\u3093\u3067\u3059\u3051\u3069\u3001\u4ee5\u5916\u306a\u3068\u3053\u308d\u3067\u300c\u3046\u30fc\u3093\u300d\u306a\u90e8\u5206\u304c\u3002<br \/>\n\u305d\u308c\u306f\u3001\u30b7\u30b9\u30c6\u30e0\u8981\u4ef6\u304c<strong>PHP7.1.3\u4ee5\u4e0a<\/strong>\u3063\u3066\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u305d\u3082\u305d\u3082PHP7.0\u7cfb\u30687.1\u7cfb\u3060\u3068\u305d\u3053\u307e\u3067\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u5909\u308f\u3089\u306a\u3044\u306e\u3067\u3001\u305d\u306e\u307e\u307e\u306b\u3057\u3066\u305f\u3093\u3067\u3059\u3051\u3069\u3001\u3053\u306e\u969b7.2\u306b\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3057\u307e\u3057\u305f\u3002\uff08\u305d\u3057\u305f\u3089\u3001\u7206\u901f\u3067\u3057\u305f\u3002PHP 8\u306eJIT\u30b3\u30f3\u30d1\u30a4\u30e9\u306b\u3082\u671f\u5f85\u304c\u3082\u3066\u307e\u3059\uff01\uff09<\/p>\n<p>\u3067\u3082\u3001VPS\u3067\u4f7f\u3046\u306b\u3057\u3066\u3082\u307e\u305fPHP\u3092\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3057\u306a\u304d\u3083\u3044\u3051\u306a\u3044\u3088\u306a\u30fc\u3001\u306a\u3093\u3066\u601d\u3046\u3068\u3061\u3087\u3063\u3068\u5104\u52ab\u306a\u3093\u3067\u3059\uff08\u7b11\uff09<\/p>\n<p>\u3082\u3046\u3044\u3044\u52a0\u6e1bvagrant\u304bdocker\u3060\u3051\u3067\u74b0\u5883\u7ba1\u7406\u3057\u305f\u307b\u3046\u304c\u3044\u3044\u3067\u3059\u304b\u306d\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb\u3002\uff08vagrant\u306fPHP 5\u7cfb\u306e\u305f\u3081\u306b\u4f7f\u3063\u3066\u307e\u3059\u3051\u3069^^;\uff09<\/p>\n<p>\u305d\u3093\u306a\u308f\u3051\u3067\u3001\u4eca\u56de\u306f\u4ee5\u4e0a\u3067\u3059\u3002<br \/>\n\u3067\u306f\u3067\u306f\u301c\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6570\u65e5\u524d\u3001Laravel5.6\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u305f\u306e\u3067\u3001\u65b0\u6a5f\u80fd\u306e\u30ed\u30b0\uff08\u30a8\u30e9\u30fc\uff09\u3092slack\u306b\u9001\u4fe1\u3059\u308b\u3068\u3044\u3046\u6a5f\u80fd\u3092\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002 \u3053\u306e\u6a5f\u80fd\u3092\u4f7f\u3048\u3070\u3001\u516c\u958b\u3057\u305f\u30b5\u30a4\u30c8\u306b\u30a8 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=264\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel5.6\u306e\u65b0\u6a5f\u80fd\u3067\u30a8\u30e9\u30fc\u3092slack\u306b\u9001\u4fe1&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":269,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,10],"tags":[37],"class_list":["post-264","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","category-php","tag-slack"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=264"}],"version-history":[{"count":5,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/264\/revisions"}],"predecessor-version":[{"id":275,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/264\/revisions\/275"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/269"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}