{"id":4505,"date":"2019-08-29T02:23:55","date_gmt":"2019-08-28T17:23:55","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=4505"},"modified":"2020-08-14T20:11:38","modified_gmt":"2020-08-14T11:11:38","slug":"%e3%83%8d%e3%83%83%e3%83%88%e3%82%ab%e3%83%95%e3%82%a7%e5%90%91%e3%81%91%e3%81%ab%e3%82%b3%e3%83%9f%e3%83%83%e3%82%af%e3%82%92%e3%81%a9%e3%81%93%e3%81%be%e3%81%a7%e8%aa%ad%e3%82%93%e3%81%a0%e3%81%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=4505","title":{"rendered":"\u30cd\u30c3\u30c8\u30ab\u30d5\u30a7\u5411\u3051\u306b\u30b3\u30df\u30c3\u30af\u3092\u3069\u3053\u307e\u3067\u8aad\u3093\u3060\u304b\u8a18\u9332\u3059\u308bLINE\u30dc\u30c3\u30c8\u3092\u3064\u304f\u3063\u305f"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u9593 <a href=\"https:\/\/blog.capilano-fw.com\/?p=4285\">Laravel\u3067LINE\u306b\u30c1\u30e3\u30c3\u30c8\u30dc\u30c3\u30c8\u3092\u3064\u304f\u308b\uff08QR\u30b3\u30fc\u30c9\u4f5c\u6210\uff09<\/a> \u3068\u3044\u3046\u8a18\u4e8b\u3092\u516c\u958b\u3057\u305f\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u969b\u306b\u307e\u3060\u307e\u3060\u4f7f\u3044\u65b9\u306b\u3088\u3063\u3066\u306f\u9762\u767d\u3044\u30b5\u30fc\u30d3\u30b9\u3092\u3064\u304f\u308c\u308b\u3093\u3058\u3083\u306a\u3044\u304b\u3068\u3001\u305a\u3063\u3068\u8003\u3048\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u306e\u6642\u306f\u3001\u307e\u3063\u305f\u304f\u4f55\u3082\u601d\u3044\u6d6e\u304b\u3070\u306a\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u3053\u306e\u9593\u4e45\u3057\u3076\u308a\u306b\u884c\u3063\u305f\u30cd\u30c3\u30c8\u30ab\u30d5\u30a7\u3067\u6f2b\u753b\u3092\u8aad\u3093\u3067\u3044\u3066\u611f\u3058\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u308c\u306f\u30fb\u30fb\u30fb<\/p>\n<p><strong style=\"font-size: 35px;\">\u3053\u306e\u6f2b\u753b\u304a\u3082\u3057\u308d\u3044\u304b\u3089\u3001\u307e\u305f\u8aad\u307f\u306b\u6765\u3088\u3046\uff01\u30fb\u30fb\u30fb\u3067\u3082\u4eca\u5ea6\u6765\u305f\u3089\u3069\u3053\u307e\u3067\u8aad\u3093\u3060\u304b\u304d\u3063\u3068\u5fd8\u308c\u3066\u308b\u3060\u308d\u3046\u306a\u30fc\ud83d\ude05<\/strong><\/p>\n<p>\u3068\u3002<\/p>\n<p>\u3082\u3061\u308d\u3093\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u306b\u30e1\u30e2\u3057\u3068\u3051\u3070\u3044\u3044\u3093\u3067\u3059\u3051\u3069\u3001\u4e00\u56de\u4e00\u56de\u3081\u3093\u3069\u3046\u3067\u3059\u3057\u3001\u3069\u3053\u306b\u30e1\u30e2\u3057\u305f\u304b\u3092\u5fd8\u308c\u3066\u3057\u307e\u3063\u305f\u308a\u3082\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\uff01<\/p>\n<p>\u4eca\u56de\u306fLINE\u30dc\u30c3\u30c8\u3067\u3053\u308c\u3092\u5b9f\u73fe\u3067\u304d\u308b\u30b7\u30b9\u30c6\u30e0\u3092\u4f5c\u3063\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002\uff08\u8a73\u3057\u3044\u5185\u5bb9\u306f\u300c\u3084\u308a\u305f\u3044\u3053\u3068\u300d\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\uff09<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u306e\u53c2\u8003\u306b\u306a\u308b\u3068\u5b09\u3057\u3044\u3067\u3059\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3566 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png\" alt=\"\" width=\"306\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png 306w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1-287x300.png 287w\" sizes=\"auto, (max-width: 306px) 100vw, 306px\" \/><\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 5.8\u3001CentOS 7.3<\/p>\n<h1>\u3084\u308a\u305f\u3044\u3053\u3068<\/h1>\n<p>\u4eca\u56de\u5b9f\u88c5\u3057\u305f\u3044\u5185\u5bb9\u306f\u4ee5\u4e0b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u6f2b\u753b\u306b\u3064\u3044\u3066\u3044\u308b\u30d0\u30fc\u30b3\u30fc\u30c9\u3092\u5199\u771f\u306b\u3068\u3063\u3066\u9001\u4fe1\u3059\u308c\u3070\u3001\u305d\u3053\u304b\u3089\u6f2b\u753b\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066\u300c\u6700\u5f8c\u306b\u8aad\u3093\u3060\u6f2b\u753b\u300d\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b<\/li>\n<li>\u30c6\u30ad\u30b9\u30c8\uff08\u30ad\u30fc\u30ef\u30fc\u30c9\uff09\u3092\u9001\u4fe1\u3059\u308c\u3070\u3001\u3059\u3067\u306b\u4fdd\u5b58\u3055\u308c\u305f\u6f2b\u753b\u30c7\u30fc\u30bf\u306e\u4e2d\u304b\u3089\u8a72\u5f53\u3059\u308b\u3082\u306e\u3092\u8fd4\u4fe1\u3059\u308b<\/li>\n<li>\u300c\u4e00\u89a7\u300d\u300c\u6700\u5f8c\u300d\u300c\u3053\u306e\u524d\u300d\u306e\u3069\u308c\u304b\u3092\u9001\u4fe1\u3059\u308c\u3070\u3001\u76f4\u8fd1\u306e\u4fdd\u5b58\u30c7\u30fc\u30bf\uff08\u6700\u5927\uff17\u4ef6\uff09\u3092\u8fd4\u4fe1\u3059\u308b<\/li>\n<li>\u767b\u9332\u30c7\u30fc\u30bf\u3092\u5168\u524a\u9664\u3057\u305f\u3044\u5834\u5408\u306f\u300c\u30d0\u30eb\u30b9\uff01\u300d\u3068\u9001\u4fe1\u3059\u308b\ud83d\ude02<\/li>\n<\/ul>\n<p>\u203b \u3069\u3046\u3084\u3089\u6700\u8fd1\u306e\u8b1b\u8ac7\u793e\u30b3\u30df\u30c3\u30af\u306f\u5916\u888b\u306b\u30d0\u30fc\u30b3\u30fc\u30c9\u304c\u8cbc\u3063\u3066\u3042\u308b\u306e\u3067\u88cf\u8868\u7d19\u306b\u306f\u30d0\u30fc\u30b3\u30fc\u30c9\u304c\u3064\u3044\u3066\u3044\u306a\u3044\u5834\u5408\u3082\u3042\u308b\u307f\u305f\u3044\u3067\u3059\u3002<s>\u305d\u306e\u5834\u5408\u306f\u3001\u4f7f\u3048\u307e\u305b\u3093\u3002\u30b4\u30e1\u30f3\u30ca\u30b5\u30a4<\/s><\/p>\n<p><strong>\u3010\u8ffd\u8a18\uff1a2019.09.02\u3011\u5199\u771f\u306e\u4ee3\u308f\u308a\u306b\u3001\u76f4\u63a5\u30c6\u30ad\u30b9\u30c8\u306713\u6841\u306eISBN\u30b3\u30fc\u30c9\u3092\u9001\u4fe1\u3057\u3066\u6f2b\u753b\u3092\u767b\u9332\u3067\u304d\u308b\u3088\u3046\u306b\u5909\u66f4\uff01<\/strong><\/p>\n<p><strong>\u3010\u8ffd\u8a18\uff1a2020.08.14\u3011\u3055\u3089\u306bOCR\u3067\u5199\u771f\u304b\u3089\u30c6\u30ad\u30b9\u30c8\u3092\u8aad\u307f\u53d6\u308a\u3001ISBN\u3092\u53d6\u5f97\u3059\u308b\u6a5f\u80fd\u3082\u8ffd\u52a0\uff01<\/strong><\/p>\n<h1>\u5148\u306b\u8a66\u3057\u3066\u307f\u308b<\/h1>\n<p>\u5148\u306b\u5b8c\u6210\u54c1\u3092\u8a66\u3057\u3066\u898b\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306eQR\u30b3\u30fc\u30c9\u3092\u8aad\u307f\u3068\u3063\u3066\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u300c\u30b3\u30df\u30c3\u30af\u306e\u3057\u304a\u308a\u300d\u3068\u3044\u3046\u540d\u524d\u306eBOT\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u203b \u3053\u306e\u30dc\u30c3\u30c8\u306f\u4eca\u5f8c\u3082\u516c\u958b\u3057\u305f\u307e\u307e\u306b\u3059\u308b\u3064\u3082\u308a\u3067\u3059\u306e\u3067\u3001\u81ea\u7531\u306b\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4521\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_7.png\" alt=\"\" width=\"184\" height=\"179\" \/><\/p>\n<p>\u3010\u30b3\u30df\u30c3\u30af\u306e\u3057\u304a\u308a\u3011<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3581\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/3.png\" alt=\"\" width=\"260\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/3.png 260w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/3-244x300.png 244w\" sizes=\"auto, (max-width: 260px) 100vw, 260px\" \/><\/p>\n<h1>LINE\u5074\u306e\u4f5c\u696d<\/h1>\n<p>\u307e\u305a\u306fLINE\u5074\u306e\u4f5c\u696d\u3067\u3059\u304c\u3001\u3053\u3061\u3089\u306f<a href=\"https:\/\/blog.capilano-fw.com\/?p=4285\">Laravel\u3067LINE\u306b\u30c1\u30e3\u30c3\u30c8\u30dc\u30c3\u30c8\u3092\u3064\u304f\u308b\uff08QR\u30b3\u30fc\u30c9\u4f5c\u6210\uff09<\/a><\/p>\n<p>\u3068\u540c\u3058\u3067\u3059\u306e\u3067\u3001\u3053\u306e\u30da\u30fc\u30b8\u306e<strong>\u300cLINE Messaging API\u3092\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u300d<\/strong>\u3068<strong>\u300c\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u300d<\/strong>\u3092\u53c2\u8003\u306b\u3057\u3066\u5b9f\u884c\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h1>\u30d0\u30fc\u30b3\u30fc\u30c9\u3092\u8aad\u307f\u53d6\u308b\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u300cZBar\u300d\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h1>\n<p>\u5b9f\u306fPHP\u672c\u4f53\u3067\u30d0\u30fc\u30b3\u30fc\u30c9\u3092\u8aad\u307f\u53d6\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3068\u3044\u3046\u306e\u306f\u3042\u307e\u308a\u5b58\u5728\u3057\u3066\u3044\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u3001\u4eca\u56de\u306f<code>ZBar<\/code>\u3068\u547c\u3070\u308c\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3092<code>Linux<\/code>\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001<code>PHP<\/code>\u304b\u3089\u3053\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u547c\u3073\u51fa\u3057\u3066\u5b9f\u88c5\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n<h2>epel\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h2>\n<p><code>ZBar<\/code>\u306f<code>epel<\/code>\u3068\u3044\u3046\u30ec\u30dd\u30b8\u30c8\u30ea\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u306e\u3067\u3001\u307e\u305a\u306f\u3053\u3061\u3089\u3092\u4f7f\u3048\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002\uff08\u3059\u3067\u306b\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u308b\u5834\u5408\u306f\u3088\u307f\u98db\u3070\u3057\u3066\u304f\u3060\u3055\u3044\uff09<\/p>\n<p>\u3069\u3053\u3067\u3082\u3044\u3044\u306e\u3067\u9069\u5f53\u306a\u30d5\u30a9\u30eb\u30c0\u306b\u79fb\u52d5\u3057\u3066\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>wget https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-7.noarch.rpm<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001<code>epel-release-latest-7.noarch.rpm<\/code>\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3055\u308c\u308b\u306e\u3067\u3001\u3055\u3089\u306b\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>sudo yum install .\/epel-release-latest-*.noarch.rpm<\/strong><\/pre>\n<h2>ZBar\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h2>\n<p><code>epel<\/code>\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u305f\u3089\u3001<code>ZBar<\/code>\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>sudo yum --enablerepo=epel install zbar-devel<\/strong><\/pre>\n<p><code>ZBar<\/code>\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001\u5ff5\u306e\u305f\u3081\u3046\u307e\u304f\u3044\u3063\u3066\u3044\u308b\u304b\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>zbarimg --version<\/strong><\/pre>\n<p>\u3046\u307e\u304f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u3066\u3044\u308c\u3070\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u8868\u793a\u3055\u308c\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<p>\u203b \u306a\u304a\u3001<code>Ubuntu<\/code>\u306e\u5834\u5408\u306f<code>sudo apt install libzbar-dev<\/code>\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u307e\u3059\u3002<\/p>\n<h1>Yahoo\u5546\u54c1API\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b<\/h1>\n<p><code>ZBar<\/code>\u3067\u8aad\u307f\u53d6\u3063\u305f<code>ISBN<\/code>\uff08\u672c\u306e\u30b3\u30fc\u30c9\uff09\u304b\u3089\u6f2b\u753b\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u3059\u308b\u305f\u3081\u306b\u3001\u4eca\u56de\u306f<a href=\"https:\/\/developer.yahoo.co.jp\/webapi\/shopping\/shopping\/v1\/itemsearch.html\" target=\"_blank\" rel=\"noopener noreferrer\">Yahoo\u5546\u54c1API<\/a>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u8a73\u3057\u304f\u306f\u3001<a href=\"https:\/\/blog.capilano-fw.com\/?p=4259\" target=\"_blank\" rel=\"noopener noreferrer\">\u30d0\u30fc\u30b3\u30fc\u30c9\u30fb\u30b9\u30ad\u30e3\u30ca\u30fc\u3067IBSN\u3092\u8aad\u307f\u53d6\u3063\u3066\u672c\u306e\u5165\u8377\u51e6\u7406\u3092\u3059\u308b<\/a>\u306e<strong>\u300c\u6e96\u5099\u3059\u308b\u300d<\/strong>\u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h1>Laravel\u5074\u306e\u4f5c\u696d<\/h1>\n<h2>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h2>\n<p>\u307e\u305a\u306f\u3001\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308a\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u3092<code>routes\/web.php<\/code>\u306b\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>Route::post('comic-bot', 'ComicBotController@webhook');<\/strong><\/pre>\n<p>\u306a\u304a\u3001<code>Laravel<\/code>\u306fPOST\u9001\u4fe1\u306e\u969b\u3001\u81ea\u52d5\u7684\u306b<code>CSRF<\/code>\u5bfe\u7b56\u3092\u9069\u7528\u3055\u305b\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u304c\u3001\u305d\u3046\u306a\u308b\u3068<code>LINE<\/code>\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u3092\u62d2\u5426\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001<code>app\/Http\/Middleware\/VerifyCsrfToken.php<\/code>\u306b\u3053\u306e\u30eb\u30fc\u30c8\u306f\u9664\u5916\u3059\u308b\u8a2d\u5b9a\u3092\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>protected $except = [<\/strong>\r\n<strong>    'comic-bot'<\/strong>\r\n<strong>];<\/strong><\/pre>\n<h2>\u30e2\u30c7\u30eb\u3068\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u3064\u304f\u308b<\/h2>\n<p>\u7d9a\u3044\u3066\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30e2\u30c7\u30eb\u3068\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>php artisan make:model ReadComic -m<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u30e2\u30c7\u30eb\u3068\u4e00\u7dd2\u306b<code>database\/migrations\/****_**_**_******_create_read_comics_table.php<\/code>\u3068\u3044\u3046\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30fb\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u306e\u3067\u3001\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre>&lt;?php\r\n\r\nuse Illuminate\\Support\\Facades\\Schema;\r\nuse Illuminate\\Database\\Schema\\Blueprint;\r\nuse Illuminate\\Database\\Migrations\\Migration;\r\n\r\nclass CreateReadComicsTable extends Migration\r\n{\r\n    public function up()\r\n    {\r\n        <strong>Schema::create('read_comics', function (Blueprint $table) {<\/strong>\r\n<strong>            $table-&gt;bigIncrements('id');<\/strong>\r\n<strong>            $table-&gt;string('user_id')-&gt;comment('LINE\u306e\u30e6\u30fc\u30b6\u30fcID');<\/strong>\r\n<strong>            $table-&gt;string('isbn')-&gt;comment('ISBN');<\/strong>\r\n<strong>            $table-&gt;string('title')-&gt;comment('\u6f2b\u753b\u306e\u30bf\u30a4\u30c8\u30eb');<\/strong>\r\n<strong>            $table-&gt;timestamps();<\/strong>\r\n\r\n<strong>            $table-&gt;unique(['user_id', 'isbn']);<\/strong>\r\n<strong>        });<\/strong>\r\n    }\r\n\r\n    public function down()\r\n    {\r\n        Schema::dropIfExists('read_comics');\r\n    }\r\n}<\/pre>\n<p>\u3053\u308c\u3067\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u3066DB\u306b\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan migrate<\/strong><\/pre>\n<p>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3059\u308b\u3068DB\u30c6\u30fc\u30d6\u30eb\u306f\u3053\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4511\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_1.png\" alt=\"\" width=\"379\" height=\"274\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_1.png 379w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_1-300x217.png 300w\" sizes=\"auto, (max-width: 379px) 100vw, 379px\" \/><\/p>\n<h2>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u3064\u304f\u308b<\/h2>\n<p>\u6700\u5f8c\u306b\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:controller ComicBotController<\/strong><\/pre>\n<p><code>app\/Http\/Controllers\/ComicBotController.php<\/code>\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse Illuminate\\Http\\Request;\r\nuse Illuminate\\Support\\Arr;\r\nuse Illuminate\\Support\\Str;\r\nuse LINE\\LINEBot;\r\nuse LINE\\LINEBot\\Event\\MessageEvent;\r\nuse LINE\\LINEBot\\Event\\MessageEvent\\ImageMessage;\r\nuse LINE\\LINEBot\\Event\\MessageEvent\\TextMessage;\r\nuse LINE\\LINEBot\\HTTPClient\\CurlHTTPClient;\r\n\r\nclass ComicBotController extends Controller\r\n{\r\n    public function webhook(Request $request) {\r\n\r\n        <strong>$channel_secret = '\uff08\u3042\u306a\u305f\u306eLINE SECRET\u30ad\u30fc\uff09'; \/\/ \u8981\u5909\u66f4<\/strong>\r\n<strong>        $access_token = '\uff08\u3042\u306a\u305f\u306eLINE \u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\uff09'; \/\/ \u8981\u5909\u66f4<\/strong>\r\n        $request_body = $request-&gt;getContent();\r\n        $hash = hash_hmac('sha256', $request_body, $channel_secret, true);\r\n        $signature = base64_encode($hash);\r\n\r\n        if($signature === $request-&gt;header('X-Line-Signature')) {   \/\/ LINE\u304b\u3089\u306e\u9001\u4fe1\u3092\u691c\u8a3c\r\n\r\n            $client = new CurlHTTPClient($access_token);\r\n            $bot = new LINEBot($client, ['channelSecret' =&gt; $channel_secret]);\r\n\r\n            try {\r\n\r\n                $events = $bot-&gt;parseEventRequest($request_body, $signature);\r\n\r\n                foreach ($events as $event) {\r\n\r\n                    if($event instanceof MessageEvent) {\r\n\r\n                        <strong>$user_id = $event-&gt;getUserId();         \/\/ LINE\u306e\u30e6\u30fc\u30b6\u30fcID<\/strong>\r\n<strong>                        $reply_token = $event-&gt;getReplyToken(); \/\/ \u8fd4\u4fe1\u7528\u30c8\u30fc\u30af\u30f3<\/strong>\r\n<strong>                        $replying_text = '';<\/strong>\r\n\r\n<strong>                        if($event instanceof ImageMessage) {   \/\/ \u65b0\u3057\u3044\u30b3\u30df\u30c3\u30af\u306e\u767b\u9332<\/strong>\r\n\r\n<strong>                            $message_id = $event-&gt;getMessageId();<\/strong>\r\n<strong>                            $response = $bot-&gt;getMessageContent($message_id);<\/strong>\r\n\r\n<strong>                            if($response-&gt;isSucceeded()) {<\/strong>\r\n\r\n<strong>                                $filename = $message_id .'.jpg';<\/strong>\r\n<strong>                                $image_path = storage_path('app\/comic_bot\/'. $filename);<\/strong>\r\n<strong>                                \\Storage::put('comic_bot\/'. $filename, $response-&gt;getRawBody());<\/strong>\r\n\r\n<strong>                                $isbn = $this-&gt;getIsbn($image_path);<\/strong>\r\n<strong>                                $comic_title = $this-&gt;getComicTitle($isbn);<\/strong>\r\n\r\n<strong>                                if(!empty($isbn) &amp;&amp; !empty($comic_title)) {<\/strong>\r\n\r\n<strong>                                    $this-&gt;saveComic($isbn, $comic_title, $user_id);<\/strong>\r\n<strong>                                    $replying_text = $this-&gt;getCompleteText($comic_title);<\/strong>\r\n\r\n<strong>                                } else {<\/strong>\r\n\r\n<strong>                                    $replying_text = \"\u30b3\u30df\u30c3\u30af\u60c5\u5831\u304c\u53d6\u5f97\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002\".<\/strong>\r\n<strong>                                        $this-&gt;emoji('100091') .<\/strong>\r\n<strong>                                        $this-&gt;emoji('100029') .<\/strong>\r\n<strong>                                        \"\\n\\n\u30d0\u30fc\u30b3\u30fc\u30c9\u3092\u5927\u304d\u3081\u306b\u64ae\u5f71\u3057\u3066\u518d\u5ea6\u9001\u4fe1\u3057\u3066\u304f\u3060\u3055\u3044\u3002\";<\/strong>\r\n\r\n<strong>                                }<\/strong>\r\n\r\n<strong>                            }<\/strong>\r\n\r\n                        } else if($event instanceof  TextMessage) { \/\/ \u904e\u53bb\u30c7\u30fc\u30bf\u306e\u691c\u7d22\r\n\r\n                            <strong>$text = $event-&gt;getText();<\/strong>\r\n\r\n<strong>                            if($this-&gt;isIsbn($text)) {<\/strong>\r\n\r\n<strong>                                $isbn = $text;<\/strong>\r\n<strong>                                $comic_title = $this-&gt;getComicTitle($isbn);<\/strong>\r\n\r\n<strong>                                if(!empty($isbn) &amp;&amp; !empty($comic_title)) {<\/strong>\r\n\r\n<strong>                                    $this-&gt;saveComic($isbn, $comic_title, $user_id);<\/strong>\r\n<strong>                                    $replying_text = $this-&gt;getCompleteText($comic_title);<\/strong>\r\n\r\n<strong>                                } else {<\/strong>\r\n\r\n<strong>                                    $replying_text = $this-&gt;getSearchText($event-&gt;getText(), $user_id);<\/strong>\r\n\r\n<strong>                                }<\/strong>\r\n\r\n<strong>                            } else if($text === '\u30d0\u30eb\u30b9\uff01') {  \/\/ \u767b\u9332\u30c7\u30fc\u30bf\u3092\u5168\u524a\u9664<\/strong>\r\n\r\n<strong>                                \\App\\ReadComic::where('user_id', $user_id)-&gt;delete();<\/strong>\r\n<strong>                                $replying_text = '\u767b\u9332\u30c7\u30fc\u30bf\u3092\u5168\u524a\u9664\u3057\u307e\u3057\u305f';<\/strong>\r\n<strong>                                $replying_text .= $this-&gt;emoji('10003A');<\/strong>\r\n\r\n<strong>                            } else if(in_array($text, ['\u4e00\u89a7', '\u6700\u5f8c', '\u3053\u306e\u524d'])) {   \/\/ \u767b\u9332\u30c7\u30fc\u30bf\u4e00\u89a7\u3092\u8fd4\u4fe1<\/strong>\r\n\r\n<strong>                                $replying_text = $this-&gt;getListText($user_id);<\/strong>\r\n\r\n<strong>                            } else {<\/strong>\r\n\r\n<strong>                                $replying_text = $this-&gt;getSearchText($event-&gt;getText(), $user_id);<\/strong>\r\n\r\n<strong>                            }<\/strong>\r\n\r\n                        }\r\n\r\n                        if(!empty($replying_text)) {\r\n\r\n                            $bot-&gt;replyText($reply_token, $replying_text);    \/\/ \u8fd4\u4fe1\r\n                            break;\r\n\r\n                        }\r\n\r\n                    }\r\n\r\n                }\r\n\r\n            } catch (\\Exception $e) {}\r\n\r\n        }\r\n\r\n    }\r\n\r\n    private function getIsbn($image_path) { \/\/ \u753b\u50cf\u304b\u3089ISBN\u3092\u53d6\u5f97\u3059\u308b\r\n\r\n        $isbn = '';\r\n\r\n        \/\/ QR Code\r\n        exec('\/usr\/bin\/zbarimg '. $image_path, $results);\r\n\r\n        foreach ($results as $result) {\r\n\r\n            list(, $code) = explode(':', $result);\r\n\r\n            if(Str::startsWith($code, '978')) { \/\/ ISBN\u306f978\u304b\u3089\u59cb\u307e\u308b\r\n\r\n                @unlink($image_path);\r\n                return $code;\r\n\r\n            }\r\n\r\n        }\r\n\r\n        \/\/ OCR\r\n        $command = '\/usr\/bin\/tesseract \"'. $image_path .'\" stdout -l eng';\r\n        exec($command, $ocr_texts);\r\n\r\n        foreach($ocr_texts as $ocr_text) {\r\n\r\n            if(preg_match_all('|978[0-9\\-]{10,}|', $ocr_text, $matches)) {\r\n\r\n                foreach($matches as $match) {\r\n\r\n                    $match_text = str_replace('-', '', $match[0]);\r\n\r\n                    if(strlen($match_text) === 13) {\r\n\r\n                        @unlink($image_path);\r\n                        return $match_text;\r\n\r\n                    }\r\n\r\n                }\r\n\r\n            }\r\n\r\n        }\r\n\r\n        @unlink($image_path);\r\n        return '';\r\n\r\n    }\r\n\r\n    private function isIsbn($text) {\r\n\r\n        return (Str::startsWith($text, '978') &amp;&amp; preg_match('|[0-9]{13}|', $text));\r\n\r\n    }\r\n\r\n    private function getComicTitle($isbn) { \/\/ \u30b3\u30df\u30c3\u30af\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u53d6\u5f97\u3059\u308b\r\n\r\n        if(empty($isbn)) {\r\n\r\n            return '';\r\n\r\n        }\r\n\r\n        $comic_title = '';\r\n        $api_url = 'https:\/\/shopping.yahooapis.jp\/ShoppingWebService\/V3\/itemSearch'.\r\n            '?appid='. env('YAHOO_APPID') .\r\n            '&amp;query='. $isbn;\r\n        $json = file_get_contents($api_url);\r\n        $data = json_decode($json, true);\r\n        $total = intval($data['totalResultsAvailable']);\r\n\r\n        if($total &gt; 0) {\r\n\r\n            $comic_title = $data['hits'][0]['name'];\r\n\r\n        }\r\n\r\n        return $comic_title;\r\n\r\n    }\r\n\r\n    private function getSearchText($text, $user_id) {   \/\/ \u691c\u7d22\u7d50\u679c\u306e\u8fd4\u4fe1\u30c6\u30ad\u30b9\u30c8\r\n\r\n        $search_text = '';\r\n        $keywords = explode(' ', trim(mb_convert_kana($text, 's')));\r\n        $query = \\App\\ReadComic::where('user_id', $user_id);\r\n\r\n        foreach ($keywords as $keyword) {\r\n\r\n            $query-&gt;where('title', 'LIKE', '%'. $keyword .'%');\r\n\r\n        }\r\n\r\n        $read_comics = $query\r\n            -&gt;orderBy('updated_at', 'desc')\r\n            -&gt;take(7)\r\n            -&gt;get();\r\n\r\n        if($read_comics-&gt;count() === 0) {\r\n\r\n            return \"[\u3054\u3081\u3093\u306a\u3055\u3044]\\n\u8a72\u5f53\u3059\u308b\u30b3\u30df\u30c3\u30af\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u30fb\u30fb\u30fb\".\r\n                $this-&gt;emoji('100094').\r\n                $this-&gt;emoji('100029').\r\n                \"\\n\\n\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u5909\u3048\u3066\u518d\u5ea6\u9001\u4fe1\u3057\u3066\u304f\u3060\u3055\u3044\u3002\".\r\n                \"\\n\\n\u203b\u300c\u6700\u5f8c\u300d\u3068\u9001\u308b\u3068\u6700\u5f8c\u306b\u767b\u9332\u3055\u308c\u305f\u30b3\u30df\u30c3\u30af\u60c5\u5831\u304c\u8fd4\u4fe1\u3055\u308c\u3001\u300c\u30d0\u30eb\u30b9\uff01\u300d\u3068\u9001\u308b\u3068\u30c7\u30fc\u30bf\u304c\u5168\u524a\u9664\u3055\u308c\u307e\u3059\".\r\n                $this-&gt;emoji('10003A');\r\n\r\n        }\r\n\r\n        $search_text .= \"\u904e\u53bb\u306b\u30fb\u30fb\u30fb\\n\\n\";\r\n\r\n        foreach ($read_comics as $read_comic) {\r\n\r\n            $search_text .= $this-&gt;getComicText($read_comic);\r\n\r\n        }\r\n\r\n        $search_text .= '\u304c\u8aad\u307e\u308c\u3066\u3044\u307e\u3059\u3002';\r\n        $search_text .= $this-&gt;emoji('10006C');\r\n        $search_text .= $this-&gt;emoji('10002D');\r\n\r\n        return $search_text;\r\n\r\n    }\r\n\r\n    private function getListText($user_id) {    \/\/ \u30c7\u30fc\u30bf\u4e00\u89a7\u306e\u8fd4\u4fe1\u30c6\u30ad\u30b9\u30c8\r\n\r\n        $search_text = '';\r\n        $read_comics = \\App\\ReadComic::where('user_id', $user_id)\r\n            -&gt;orderBy('updated_at', 'desc')\r\n            -&gt;take(7)\r\n            -&gt;get();\r\n\r\n        if($read_comics-&gt;count() === 0) {\r\n\r\n            $search_text = \"\u307e\u3060\u30c7\u30fc\u30bf\u304c\u767b\u9332\u3055\u308c\u3066\u3044\u307e\u305b\u3093\".\r\n                $this-&gt;emoji('100091') .\r\n                $this-&gt;emoji('100029') .\r\n                \"\\n\\n\u30b3\u30df\u30c3\u30af\u306e\u30d0\u30fc\u30b3\u30fc\u30c9\uff08ISBN\uff09\u3092\u5199\u771f\u3067\u9001\u4fe1\u3057\u3066\u304f\u3060\u3055\u3044\u3002\";\r\n\r\n        } else {\r\n\r\n            $search_text = \"\u6700\u5f8c\u306b\u8aad\u307e\u308c\u305f\u306e\u306f\u30fb\u30fb\u30fb\\n\\n\";\r\n\r\n            foreach ($read_comics as $read_comic) {\r\n\r\n                $search_text .= $this-&gt;getComicText($read_comic);\r\n\r\n            }\r\n\r\n            $search_text .= '\u3067\u3059';\r\n            $search_text .=  $this-&gt;emoji(100039);\r\n\r\n        }\r\n\r\n        return $search_text;\r\n\r\n    }\r\n\r\n    private function getComicText($read_comic) {    \/\/ \u30b3\u30df\u30c3\u30af\u60c5\u5831\u306e\u8fd4\u4fe1\u30c6\u30ad\u30b9\u30c8\r\n\r\n        $dt = $read_comic-&gt;updated_at;\r\n        $day_of_week = Arr::get(['\u65e5', '\u6708', '\u706b', '\u6c34', '\u6728', '\u91d1', '\u571f'], $dt-&gt;format('w'));\r\n        return '['. $read_comic-&gt;updated_at-&gt;format('Y\/m\/d\uff08'. $day_of_week .'\uff09H\u6642i\u5206') .\"]\\n\".\r\n            $read_comic-&gt;title .\"\\n\\n\";\r\n\r\n    }\r\n\r\n    private function getCompleteText($comic_title) {\r\n\r\n        $text = '[\u767b\u9332\u5b8c\u4e86]' .\r\n                \"\\n\\n\". $comic_title .\r\n                \"\\n\\n\u306e\u767b\u9332\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\";\r\n        $text .= $this-&gt;emoji('10007F');\r\n        $text .= $this-&gt;emoji('10002D');\r\n        return $text;\r\n\r\n    }\r\n\r\n    private function saveComic($isbn, $comic_title, $user_id) {\r\n\r\n        $read_comic = \\App\\ReadComic::where('user_id', $user_id)\r\n            -&gt;where('isbn', $isbn)\r\n            -&gt;first();\r\n\r\n        if(is_null($read_comic)) {\r\n\r\n            $read_comic = new \\App\\ReadComic();\r\n            $read_comic-&gt;user_id = $user_id;\r\n            $read_comic-&gt;isbn = $isbn;\r\n            $read_comic-&gt;title = $comic_title;\r\n\r\n        } else {\r\n\r\n            $read_comic-&gt;updated_at = now();\r\n\r\n        }\r\n\r\n        $read_comic-&gt;save();\r\n\r\n    }\r\n\r\n    <strong>private function emoji($emoji_id) {<\/strong>\r\n\r\n<strong>        $bin = hex2bin(str_pad($emoji_id, 8, '0', STR_PAD_LEFT));<\/strong>\r\n<strong>        return mb_convert_encoding($bin, 'UTF-8', 'UTF-32BE');<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p><strong>\u3010\u8ffd\u8a18\uff1a2019.09.02\u3011\u30d0\u30fc\u30b3\u30fc\u30c9\u304c\u6f2b\u753b\u306b\u5370\u5237\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u3092\u8003\u616e\u3057\u3066\u3001\u76f4\u63a513\u6841\u306eISBN\u30b3\u30fc\u30c9\u3092\u9001\u4fe1\u3057\u3066\u6f2b\u753b\u767b\u9332\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u3002<\/strong><\/p>\n<p><strong>\u3010\u8ffd\u8a18\uff1a2020.08.14\u3011Yahoo\u5546\u54c1API\u304cV3\u306b\u79fb\u884c\u3057\u305f\u306e\u3067\u3001getComicTitle()\u3092\u5909\u66f4\u3057\u307e\u3057\u305f\u3002\u3055\u3089\u306b\u30d0\u30fc\u30b3\u30fc\u30c9\u304c\u5370\u5237\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306b\u3044\u3061\u3044\u3061ISBN\u30b3\u30fc\u30c9\u3092\u6253\u3061\u8fbc\u3080\u306e\u304c\u9762\u5012\u306a\u306e\u3067OCR\u3067\u5199\u771f\u304b\u3089ISBN\u3092\u8aad\u307f\u53d6\u308b\u30b3\u30fc\u30c9\u3082\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002OCR\u306b\u3064\u3044\u3066\u306f\u3001<a href=\"https:\/\/blog.capilano-fw.com\/?p=4892\" target=\"_blank\" rel=\"noopener noreferrer\">\u7121\u6599\u3067\u3067\u304d\u308b\uff01PHP\u3067\u753b\u50cf\u304b\u3089\u30c6\u30ad\u30b9\u30c8\u3092\u8aad\u307f\u53d6\u308b\u65b9\u6cd5<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\uff01<\/strong><\/p>\n<p>\u8a18\u4e8b\u3068\u3057\u3066\u306f\u88c5\u98fe\u7684\u306a\u5185\u5bb9\u306f\u524a\u3063\u3066\u304a\u304f\u3079\u304d\u3067\u3059\u304c\u3001\u500b\u4eba\u7684\u306b\u697d\u3057\u304f\u306a\u3063\u3066\u3057\u307e\u3063\u3066\u30b3\u30fc\u30c9\u304c\u5897\u3048\u3066\u3057\u307e\u3044\u307e\u3057\u305f\ud83d\ude05<\/p>\n<p>\u91cd\u8981\u306a\u90e8\u5206\u3092\u7d39\u4ecb\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h3>\u74b0\u5883\u306b\u3088\u3063\u3066\u5909\u66f4\u3059\u308b\u90e8\u5206<\/h3>\n<p>\u30b3\u30fc\u30c9\u306e\u4e2d\u306b\u306f\u3001\u74b0\u5883\u306b\u3088\u3063\u3066\u5909\u66f4\u3059\u308b\u5909\u6570\u304c\uff13\u30f6\u6240\u3042\u308a\u307e\u3059\u3002<br \/>\n\u305d\u308c\u306f\u3001\u30b3\u30fc\u30c9\u5185\u3067\u300c\u8981\u5909\u66f4\u300d\u3068\u66f8\u304b\u308c\u3066\u3044\u308b\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p>\u8a73\u3057\u304f\u66f8\u304f\u3068\u4ee5\u4e0b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ol>\n<li>$channel_secret\u3000\u30fb\u30fb\u30fb\u3000LINE Messaging API \u306e\u79d8\u5bc6\u9375<\/li>\n<li>$access_token\u3000\u30fb\u30fb\u30fb\u3000\u540c\u3058\u304f LINE Messaging API\u306e\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3<\/li>\n<li>$api_url\u306b\u542b\u307e\u308c\u308bappid\u3000\u30fb\u30fb\u30fb\u3000Yahoo\u5546\u54c1API\u306eappid<\/li>\n<\/ol>\n<p>\u306a\u304a\u3001\u3053\u308c\u3089\u306e\u60c5\u5831\u306f\u4fbf\u5b9c\u4e0a\u30b3\u30fc\u30c9\u5185\u306b\u542b\u3081\u3066\u3044\u307e\u3059\u304c\u3001\u7ba1\u7406\u3057\u3084\u3059\u3044\u306e\u3067<code>.env<\/code>\u306a\u3069\u306b\u8a18\u8ff0\u3057\u3066\u304a\u304f\u3053\u3068\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\u3002<\/p>\n<h3>ZBar\u304b\u3089ISBN\u3092\u53d6\u5f97\u3059\u308b\u90e8\u5206<\/h3>\n<pre><strong>exec('\/usr\/bin\/zbarimg '. $image_path, $results);<\/strong><\/pre>\n<p>\u3053\u3061\u3089\u3082\u74b0\u5883\u306b\u3088\u3063\u3066\u9055\u3063\u3066\u304f\u308b\u306e\u3067\u3059\u304c\u3001<code>zbarimg<\/code>\u30b3\u30de\u30f3\u30c9\u3092<code>PHP<\/code>\u304b\u3089\u5b9f\u884c\u3059\u308b\u306b\u306f\u3001\u7d76\u5bfe\u30d1\u30b9\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u3053\u306e<code>\/usr\/bin\/zbarimg<\/code>\u306e\u90e8\u5206\u306f<strong>\u5229\u7528\u3057\u3066\u3044\u308bOS\u306b\u3088\u3063\u3066\u9055\u3063\u3066\u304f\u308b<\/strong>\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u8868\u793a\u3055\u308c\u308b\u30d1\u30b9\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>which zbarimg<\/strong><\/pre>\n<h3>LINE\u3078\u306e\u8fd4\u4fe1<\/h3>\n<p>\u304a\u304a\u307e\u304b\u306b\u4ee5\u4e0b\uff12\u3064\u306e\u30d1\u30bf\u30fc\u30f3\u306b\u5225\u308c\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u753b\u50cf\u304c\u9001\u4fe1\u3055\u308c\u3066\u304d\u305f\u3000\u30fb\u30fb\u30fb\u3000\u30d0\u30fc\u30b3\u30fc\u30c9\u304b\u3089ISBN\u3092\u53d6\u5f97\u3057\u3066\u6f2b\u753b\u60c5\u5831\u3092\u4fdd\u5b58\u3059\u308b<\/li>\n<li>\u30c6\u30ad\u30b9\u30c8\u304c\u9001\u3089\u308c\u3066\u304d\u305f\u3000\u30fb\u30fb\u30fb\u3000\u767b\u9332\u30c7\u30fc\u30bf\u306e\u691c\u7d22\u3001\u4e00\u89a7\u306e\u8868\u793a\u3001\u3082\u3057\u304f\u306f\u524d\u30c7\u30fc\u30bf\u524a\u9664\u306e\u547d\u4ee4<\/li>\n<\/ul>\n<p>\u306a\u304a\u3001<code>emoji()<\/code>\u30e1\u30bd\u30c3\u30c9\u306f\u3001<code>LINE<\/code>\u306e\u7d75\u6587\u5b57\u3092\u30e1\u30c3\u30bb\u30fc\u30b8\u5185\u3067\u4f7f\u3046\u305f\u3081\u306e\u3082\u306e\u3067\u3059\u3002\u5f15\u6570\u306e<code>$emoji_id<\/code>\u306f\u3001<a href=\"https:\/\/developers.line.biz\/media\/messaging-api\/emoji-list.pdf\" target=\"_blank\" rel=\"noopener noreferrer\">\u7d75\u6587\u5b57\u306e\u30ea\u30b9\u30c8\u30da\u30fc\u30b8<\/a>\u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u304c\u3001<code>0x<\/code>\u306e\u90e8\u5206\u306f\u7701\u3044\u3066\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>Storage\u30d5\u30a9\u30eb\u30c0\u306b\u3064\u3044\u3066<\/h3>\n<p>\u3082\u3057\u304b\u3059\u308b\u3068\u3001<code>storage\/app\/comic_bot<\/code>\u3068\u3044\u3046\u30d5\u30a9\u30eb\u30c0\u304c\u306a\u3044\u3068\u30a8\u30e9\u30fc\u3067\u3046\u307e\u304f\u3044\u304b\u306a\u3044\u53ef\u80fd\u6027\u3082\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u9069\u5b9c\u3053\u306e\u30d5\u30a9\u30eb\u30c0\u3092\u3064\u304f\u3063\u3066\u66f8\u304d\u8fbc\u307f\u6a29\u9650\u3092\u4ed8\u3051\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h1>\u3061\u306a\u307f\u306b\uff1a\u958b\u767a\u306e\u30a2\u30c9\u30d0\u30a4\u30b9<\/h1>\n<p>\u3053\u3046\u3044\u3063\u305f\u30a6\u30a7\u30d6\u30d5\u30c3\u30af\u6a5f\u80fd\u306e\u958b\u767a\u306f\u901a\u5e38\u306e\u958b\u767a\u3068\u9055\u3063\u3066\u5b9f\u884c\u7d50\u679c\u3092\u76f4\u63a5\u76ee\u3067\u898b\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u3001\u958b\u767a\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3068\u3057\u3066\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30ed\u30b0\u306b\u5185\u5bb9\u3092\u6b8b\u3059\u306a\u3069\u3057\u3066\u78ba\u8a8d\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>\\Log::info('\u3053\u3053\u306b\u4f55\u304b\u306e\u60c5\u5831');<\/strong><\/pre>\n<p>\u3053\u306e\u5834\u5408\u3001<code>\/storage\/logs<\/code>\u5185\u306b\u65e5\u4ed8\u3054\u3068\u306b\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u306e\u3067\u3001<\/p>\n<pre><strong>tail (\u30d5\u30a1\u30a4\u30eb\u540d)<\/strong><\/pre>\n<p>\u3082\u3057\u304f\u306f\u3001\u884c\u6570\u3092\u6307\u5b9a\u3059\u308b<\/p>\n<pre><strong>tail (\u30d5\u30a1\u30a4\u30eb\u540d) -n 150<\/strong><\/pre>\n<p>\u306a\u3069\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u78ba\u8a8d\u3059\u308b\u3068\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u203b \u3082\u3057\u304f\u306f\u3001<code>LINE<\/code>\u306b\u5fc5\u8981\u306a\u5185\u5bb9\u3092\u8fd4\u4fe1\u3057\u3066\u3057\u307e\u3063\u3066\u3082\u3044\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\uff01<\/p>\n<p>\u3068\u3044\u3063\u3066\u3082\u3001\u79c1\u306e\u90e8\u5c4b\u306b\u306f\u6f2b\u753b\u304c\u3082\u3046\u306a\u3044\u306e\u3067\u3001\u30a6\u30a7\u30d6\u4e0a\u304b\u3089\u62fe\u3063\u3066\u304d\u305f\u753b\u50cf\u3067\u8a66\u3057\u3066\u307f\u307e\u3059\u3002\uff08\u30ab\u30ca\u30c0\u7559\u5b66\u3059\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u306b\u5168\u90e8\u6368\u3066\u3066\u3057\u307e\u3063\u3066\u3061\u3087\u3063\u3068\u5f8c\u6094\u30fb\u30fb\u30fb\ud83d\ude05\uff09<\/p>\n<p>\u3067\u306f\u3001\u307e\u305a\u306f\u30d0\u30fc\u30b3\u30fc\u30c9\u3092\u9001\u3063\u3066\u6f2b\u753b\u3092\u767b\u9332\u3059\u308b\u3068\u3053\u308d\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4518\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_3.png\" alt=\"\" width=\"1080\" height=\"1262\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_3.png 1080w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_3-257x300.png 257w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_3-768x897.png 768w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_3-876x1024.png 876w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<p>\u7d9a\u3044\u3066\u767b\u9332\u30c7\u30fc\u30bf\u3092\u691c\u7d22\u3059\u308b\u3068\u3053\u308d\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4517\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_4.png\" alt=\"\" width=\"1080\" height=\"555\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_4.png 1080w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_4-300x154.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_4-768x395.png 768w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_4-1024x526.png 1024w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<p>\u691c\u7d22\u7d50\u679c\u304c\u898b\u3064\u304b\u3089\u306a\u304b\u3063\u305f\u3068\u3053\u308d\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4519\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_2.png\" alt=\"\" width=\"1080\" height=\"884\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_2.png 1080w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_2-300x246.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_2-768x629.png 768w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_2-1024x838.png 1024w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<p>\u6700\u5f8c\u306b\u4f8b\u306e\u300c\u546a\u6587\u300d\u3092\u5531\u3048\u305f\u3068\u3053\u308d\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4516\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_5.png\" alt=\"\" width=\"1080\" height=\"258\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_5.png 1080w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_5-300x72.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_5-768x183.png 768w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_5-1024x245.png 1024w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<p>\u306f\u3044\uff01<br \/>\n\u5168\u3066\u3046\u307e\u304f\u3044\u3063\u305f\u3088\u3046\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f<code>LINE<\/code>\u306b\u6f2b\u753b\u60c5\u5831\u3092\u4fdd\u5b58\u3057\u3066\u304f\u308c\u308b\u30dc\u30c3\u30c8\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u307e\u3060\u3001\u5b9f\u969b\u306b\u30cd\u30ab\u30d5\u30a7\u3067\u4f7f\u3063\u3066\u307e\u305b\u3093\u304c\u81ea\u5206\u3067\u3082\u4f7f\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\uff08\u3042\u3093\u307e\u308a\u4fbf\u5229\u3055\u304c\u611f\u3058\u3089\u308c\u306a\u304b\u3063\u305f\u3089\u3001\u3053\u3063\u305d\u308a\u30b5\u30fc\u30d3\u30b9\u3092\u6d88\u3059\u304b\u3082\u3067\u3059\u304c\ud83d\ude05\uff09<\/p>\n<p>\u307e\u305f\u3001\u4ee5\u524d\u4f5c\u6210\u3057\u305fQR\u30b3\u30fc\u30c9\u3092\u4f5c\u3063\u3066\u304f\u308c\u308b<code>LINE<\/code>\u30dc\u30c3\u30c8\u3082\u516c\u958b\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u306e\u3067\u3001\u8208\u5473\u306e\u3042\u308b\u65b9\u306f\u305c\u3072\u3053\u3061\u3089\u3082\u8a66\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3010QR\u30b3\u30fc\u30c9\u3092\u3064\u304f\u308b and \u8aad\u3080\u3011<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4520\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/line_bot_comic_6.png\" alt=\"\" width=\"194\" height=\"186\" \/><\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4445 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png\" alt=\"\" width=\"370\" height=\"310\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2-300x251.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u9593 Laravel\u3067LINE\u306b\u30c1\u30e3\u30c3\u30c8\u30dc\u30c3\u30c8\u3092\u3064\u304f\u308b\uff08QR\u30b3\u30fc\u30c9\u4f5c\u6210\uff09 \u3068\u3044\u3046\u8a18\u4e8b\u3092\u516c\u958b\u3057\u305f\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u969b\u306b\u307e\u3060\u307e\u3060\u4f7f\u3044\u65b9\u306b\u3088\u3063\u3066\u306f\u9762\u767d\u3044\u30b5\u30fc\u30d3 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=4505\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u30cd\u30c3\u30c8\u30ab\u30d5\u30a7\u5411\u3051\u306b\u30b3\u30df\u30c3\u30af\u3092\u3069\u3053\u307e\u3067\u8aad\u3093\u3060\u304b\u8a18\u9332\u3059\u308bLINE\u30dc\u30c3\u30c8\u3092\u3064\u304f\u3063\u305f&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":4524,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,17],"tags":[164],"class_list":["post-4505","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","category-17","tag-line"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/4505","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=4505"}],"version-history":[{"count":15,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/4505\/revisions"}],"predecessor-version":[{"id":7698,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/4505\/revisions\/7698"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/4524"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4505"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}