{"id":3764,"date":"2019-06-07T20:39:16","date_gmt":"2019-06-07T11:39:16","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=3764"},"modified":"2019-06-07T20:39:16","modified_gmt":"2019-06-07T11:39:16","slug":"laravel%e3%81%a7sms%ef%bc%88%e3%82%b7%e3%83%a7%e3%83%bc%e3%83%88%e3%83%a1%e3%83%83%e3%82%bb%e3%83%bc%e3%82%b8%ef%bc%89%e3%82%92%e9%80%81%e4%bf%a1%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=3764","title":{"rendered":"Laravel\u3067SMS\uff08\u30b7\u30e7\u30fc\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\uff09\u3092\u9001\u4fe1\u3059\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001Laravel\u597d\u304d\u306a\u79c1\u304b\u3089\u3059\u308b\u3068\u65b0\u3057\u3044\u6a5f\u80fd\u3084\u4f53\u9a13\u3057\u3066\u3044\u306a\u3044\u6a5f\u80fd\u306f\u6700\u4f4e\uff11\u5ea6\u306f\u4eca\u5f8c\u306e\u958b\u767a\u306e\u305f\u3081\u306b\u89e6\u3063\u3066\u898b\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u305d\u3093\u306a\u4e2d\u3067\u3082\u5c11\u3057\u3060\u3051\u6577\u5c45\u304c\u9ad8\u3044\u3068\u3044\u3046\u304b\u300c\u3061\u3087\u3063\u3068\u3081\u3093\u3069\u3046\u300d\u611f\u304c\u51fa\u3066\u3057\u307e\u3046\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u304c\u3001<strong>\u8ab2\u91d1\u304c\u5fc5\u8981\u306b\u306a\u308b\u6a5f\u80fd<\/strong>\u3067\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u305d\u306e\u4e2d\u3067\u6c17\u306b\u306a\u3063\u3066\u3044\u305f\u306e\u304c<strong>\u300cSMS\uff08\u30b7\u30e7\u30fc\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\uff09\u9001\u4fe1\u6a5f\u80fd\u300d<\/strong>\u3002<\/p>\n<p>SMS\u3068\u306f\u3001\u96fb\u8a71\u756a\u53f7\u3092\u4f7f\u3063\u3066\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1\u3059\u308b\u30b5\u30fc\u30d3\u30b9\u306e\u3053\u3068\u3067\u3001\u6700\u8fd1\u3067\u306f\u5165\u529b\u3055\u308c\u305f\u643a\u5e2f\u756a\u53f7\u304c\u672c\u5f53\u306b\u6b63\u3057\u3044\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u305f\u3081\u306bSMS\u3067\u300c\u8a8d\u8a3c\u756a\u53f7\u300d\u3092\u9001\u4fe1\u3057\u3001\u305d\u306e\u756a\u53f7\u3092\u5165\u529b\u3057\u3066\u3082\u3089\u3046\u3068\u3044\u3046\u5f62\u3092\u3068\u3063\u3066\u3044\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<p>Laravel\u3067\u306f\u3001SMS\u6a5f\u80fd\u3092<code>Notification<\/code>\u3068<a href=\"https:\/\/www.nexmo.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Nexmo<\/a>\u3068\u3044\u3046\u30b5\u30a4\u30c8\u9023\u643a\u3055\u305b\u3066\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u30af\u30ec\u30b8\u30c3\u30c8\u30ab\u30fc\u30c9\u306e\u767b\u9332\u306a\u3069\u304c\u5c11\u3057\u3081\u3093\u3069\u3046\u3060\u306a\u3068\u601d\u3044\u305a\u3063\u3068\u5b9f\u884c\u3057\u306a\u3044\u307e\u307e\u306b\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u3001<span style=\"font-size: 1rem;\">\u6700\u8fd1<code>Nexmo<\/code>\u306b\u306f\u7121\u6599\u306e\u30c8\u30e9\u30a4\u30a2\u30eb\u7248\u304c\u3042\u308b\u3053\u3068\u3092\u77e5\u308a\u307e\u3057\u305f\u3002<\/span><\/p>\n<p>\u305d\u3053\u3067\uff01\u4eca\u56de\u306f\u305d\u306e\u5c11\u3057\u91cd\u305f\u3044\u8170\u3092\u4e0a\u3052\u3066\ud83d\ude02\u3001Laravel\u304b\u3089SMS\u3092\u9001\u4fe1\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u306e\u304a\u5f79\u306b\u7acb\u3066\u308b\u3068\u5b09\u3057\u3044\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2173 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/no_24.png\" alt=\"\" width=\"300\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/no_24.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/no_24-281x300.png 281w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\u5b9f\u884c\u74b0\u5883\uff1a Laravel 5.8<\/p>\n<h1>SMS\u3092\u4f7f\u3046\u6e96\u5099\u3092\u3059\u308b<\/h1>\n<h2>Nexmo\u306b\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u3064\u304f\u308b<\/h2>\n<p><code>Nexmo<\/code>\u3068\u306f\u3001<code>SMS<\/code>\u3092\u9001\u4fe1\u3059\u308b\u306a\u3069\u69d8\u3005\u306a\u30b5\u30fc\u30d3\u30b9\u3092\u5c55\u958b\u3057\u3066\u3044\u308b\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u3067\u3059\u304c\u3001<code>Laravel<\/code>\u306e<code>Notification<\/code>\u3067\u306f\u3001\u3053\u306e<code>Nexmo<\/code>\u3092\u4f7f\u3063\u3066<code>SMS<\/code>\u3092\u9001\u4fe1\u3057\u307e\u3059\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u307e\u305a\u306f<a href=\"https:\/\/www.nexmo.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u30c8\u30c3\u30d7\u30da\u30fc\u30b8<\/a>\u3078\u30a2\u30af\u30bb\u30b9\u3057\u3066\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u306f\u300c<strong>TRY IT FREE<\/strong>\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3772\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_1.png\" alt=\"\" width=\"439\" height=\"111\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_1.png 439w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_1-300x76.png 300w\" sizes=\"auto, (max-width: 439px) 100vw, 439px\" \/><\/p>\n<p>\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a2\u30ab\u30a6\u30f3\u30c8\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u5165\u529b\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306f\u8d64\u67a0\u306e\u5fc5\u9808\u9805\u76ee\u3067\u3059\u3002<\/p>\n<ul>\n<li>First name\u3000\u30fb\u30fb\u30fb\u3000\u540d<\/li>\n<li>Last name\u3000\u30fb\u30fb\u30fb\u3000\u59d3<\/li>\n<li>Email address\u3000\u30fb\u30fb\u30fb\u3000\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9<\/li>\n<li>Phone number\u3000\u30fb\u30fb\u30fb\u3000\u96fb\u8a71\u756a\u53f7\u3000\u203b\u6ce8\uff11<\/li>\n<li>Password\u3000\u30fb\u30fb\u30fb\u3000\u30d1\u30b9\u30ef\u30fc\u30c9<\/li>\n<\/ul>\n<p>\u203b\u6ce8\uff11\uff1a\u96fb\u8a71\u756a\u53f7\u306f\u3001\u4f8b\u3048\u3070<strong>\u300c090-****-****\u300d<\/strong>\u306e\u5834\u5408<strong>\u300c90-****-****\u300d<\/strong>\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u56fd\u969b\u96fb\u8a71\u3092\u639b\u3051\u308b\u5834\u5408\u3068\u540c\u3058\u3067\u3059\u306d\u3002<\/p>\n<p>\u5165\u529b\u304c\u7d42\u308f\u3063\u305f\u3089\u300c<strong>Sign up<\/strong>\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-3771 alignnone\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_2.png\" alt=\"\" width=\"581\" height=\"692\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_2.png 581w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_2-252x300.png 252w\" sizes=\"auto, (max-width: 581px) 100vw, 581px\" \/><\/p>\n<p>\u3059\u308b\u3068\u3001\u3059\u3050\u306b\u30da\u30fc\u30b8\u304c\u79fb\u52d5\u3057\u3001\u5165\u529b\u3057\u305f\u643a\u5e2f\u756a\u53f7\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a<code>SMS<\/code>\u304c\u9001\u4fe1\u3055\u308c\u3066\u6765\u307e\u3059\u306e\u3067\u305d\u306e\u8a8d\u8a3c\u756a\u53f7\u3092\u5165\u529b\u3057\u3066\u9001\u4fe1\u3057\u3066\u304f\u3060\u3055\u3044\u3002\uff08\u3059\u307f\u307e\u305b\u3093\u30d5\u30a9\u30fc\u30e0\u306e\u30ad\u30e3\u30d7\u30c1\u30e3\u53d6\u308a\u5fd8\u308c\u307e\u3057\u305f\ud83d\udca6\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3774\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_9.png\" alt=\"\" width=\"788\" height=\"228\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_9.png 788w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_9-300x87.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_9-768x222.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<p>\u307e\u305f\u3001\u5165\u529b\u3057\u305f\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306b\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u6709\u52b9\u306b\u3059\u308b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u5c4a\u3044\u3066\u3044\u308b\u306e\u3067\u8d64\u67a0\u306e\u90e8\u5206\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3775\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_3.png\" alt=\"\" width=\"601\" height=\"589\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_3.png 601w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_3-300x294.png 300w\" sizes=\"auto, (max-width: 601px) 100vw, 601px\" \/><\/p>\n<p>\u3053\u308c\u3067\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u4f5c\u6210\u306f\u5b8c\u4e86\u3057\u307e\u3057\u305f\uff01<\/p>\n<p>\u203b \u3061\u306a\u307f\u306b\u3001Nexmo\u306e\u7121\u6599\u30c8\u30e9\u30a4\u30a2\u30eb\u306e\u5236\u9650\u306f\u4ee5\u4e0b\u306e\uff13\u3064\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u7121\u6599\u3067\u4f7f\u3048\u308b\u306e\u306f\u20ac2\uff08\uff12\u30e6\u30fc\u30ed\uff09\u307e\u3067<\/li>\n<li>\u30a2\u30ab\u30a6\u30f3\u30c8\u767b\u9332\u3057\u305f\u96fb\u8a71\u756a\u53f7\u4ee5\u5916\u306b\u9001\u4fe1\u3059\u308b\u306b\u306f\u3042\u3089\u304b\u3058\u3081\u300c\u30c6\u30b9\u30c8\u96fb\u8a71\u756a\u53f7\u300d\u3092\u767b\u9332\u3057\u3066\u304a\u304b\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3002<\/li>\n<li>\u9001\u4fe1\u3055\u308c\u305f\u30b7\u30e7\u30fc\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u6700\u5f8c\u306b\u300cFREE SMS DEMO, TEST MESSAGE\u300d\u3068\u3044\u3046\u30c6\u30ad\u30b9\u30c8\u304c\u8ffd\u52a0\u3055\u308c\u308b<\/li>\n<\/ol>\n<h2>Laravel\u5074\u306e\u6e96\u5099\u3092\u3059\u308b<\/h2>\n<h3>API\u30ad\u30fc\u3092\u8a2d\u7f6e\u3059\u308b<\/h3>\n<p><code>Nexmo<\/code>\u306b\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u305f\u3089\u3001\u6b21\u306f<code>Laravel<\/code>\u5074\u306e\u6e96\u5099\u3067\u3059\u3002<br \/>\n\u30ed\u30b0\u30a4\u30f3\u3057\u305f\u72b6\u614b\u3067\u3001\u753b\u9762\u5de6\u5074\u30e1\u30cb\u30e5\u30fc\u306e<strong>\u300cGetting started\u300d<\/strong>\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3787\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_15.png\" alt=\"\" width=\"269\" height=\"199\" \/><\/p>\n<p>\u3059\u308b\u3068\u3001\u6b21\u306e\u753b\u9762\u3067\u306fLaravel\u3067\u5fc5\u8981\u306b\u306a\u308b<code>Nexmo<\/code>\u306eAPI\u30ad\u30fc\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u3053\u308c\u3092<code>.env<\/code>\u306b\u66f8\u304d\u8fbc\u3093\u3067\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3788\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_16.png\" alt=\"\" width=\"616\" height=\"132\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_16.png 616w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_16-300x64.png 300w\" sizes=\"auto, (max-width: 616px) 100vw, 616px\" \/><\/p>\n<pre><strong>NEXMO_KEY=*******\r\nNEXMO_SECRET=****************<\/strong><\/pre>\n<p>\u307e\u305f\u3001\u3053\u306e\u30ad\u30fc\u3092<code>Notification<\/code>\u304c\u53c2\u7167\u3067\u304d\u308b\u3088\u3046\u306b<code>config\/services.php<\/code>\u306b\u3082\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3092\u8ffd\u52a0\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<pre>&lt;?php\r\n\r\nreturn [\r\n\r\n    \/\/ \u7701\u7565\r\n\r\n    <strong>'nexmo' =&gt; [<\/strong>\r\n<strong>        'key' =&gt; env('NEXMO_KEY'),<\/strong>\r\n<strong>        'secret' =&gt; env('NEXMO_SECRET'),<\/strong>\r\n<strong>        'sms_from' =&gt; '8190********',<\/strong>\r\n<strong>    ],<\/strong>\r\n\r\n];<\/pre>\n<p>\u203b <code>sms_from<\/code>\u306f\u3001\u9001\u4fe1\u5143\u306b\u306a\u308b\u96fb\u8a71\u756a\u53f7\u3067\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001Laravel\u3067Nexmo\u3092\u4f7f\u3046\u305f\u3081\u306b\u5c02\u7528\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u4ee5\u4e0b\u306e<code>composer<\/code>\u30b3\u30de\u30f3\u30c9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>composer require laravel\/nexmo-notification-channel<\/strong><\/pre>\n<h3>users\u30c6\u30fc\u30d6\u30eb\u306b\u96fb\u8a71\u756a\u53f7\u306e\u9805\u76ee\u3092\u8ffd\u52a0\u3059\u308b<\/h3>\n<p><strong>\uff08\u6ce8\u610f\uff09<\/strong><span style=\"font-size: 1rem;\">\u3059\u3067\u306b<\/span><code>php artisan make:auth<\/code><span style=\"font-size: 1rem;\">\u3067\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u30b7\u30b9\u30c6\u30e0\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u524d\u63d0\u3067\u3059\u3002\u8a73\u3057\u304f\u306f\u3001<\/span><a style=\"font-size: 1rem;\" href=\"https:\/\/blog.capilano-fw.com\/?p=289\">\u3010Laravel5.6\u3011\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u76f4\u5f8c\u306b\u3084\u308b\u3053\u3068\uff13\u70b9<\/a><span style=\"font-size: 1rem;\">\u306e\u300c\u30ed\u30b0\u30a4\u30f3\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u30ea\u30de\u30a4\u30f3\u30c0\u30fc\u6a5f\u80fd\u3092\u69cb\u7bc9\u300d\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/span><\/p>\n<p>SMS\u3092\u4f7f\u3063\u305f<code>Notification<\/code>\u306f\u3001<code>users<\/code>\u30c6\u30fc\u30d6\u30eb\u306e<code>phone_number<\/code>\u3068\u3044\u3046\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u53c2\u7167\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001<code>phone_number<\/code>\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u7528\u610f\u3055\u308c\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u72ec\u81ea\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>php artisan make:migration add_phone_number_to_users_table<\/strong><\/pre>\n<p>\u305d\u3057\u3066\u3001\u4f5c\u6210\u3055\u308c\u305f<code>database\/migrations\/****_**_**_******_add_phone_number_to_users_table.php<\/code>\u3092\u958b\u3044\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306b\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 AddPhoneNumberToUsersTable extends Migration\r\n{\r\n    public function up()\r\n    {\r\n\u00a0       <strong>Schema::table('users', function (Blueprint $table) {<\/strong>\r\n<strong>            $table-&gt;string('phone_number')<\/strong>\r\n<strong>                -&gt;nullable()<\/strong>\r\n<strong>                -&gt;after('email_verified_at');<\/strong>\r\n<strong>        });<\/strong>\r\n    }\r\n\r\n    public function down()\r\n    {\r\n        <strong>Schema::table('users', function (Blueprint $table) {<\/strong>\r\n<strong>            $table-&gt;dropColumn('phone_number');<\/strong>\r\n<strong>        });<\/strong>\r\n    }\r\n}<\/pre>\n<p>\u305d\u3057\u3066\u3001\u5fd8\u308c\u3066\u306f\u3044\u3051\u306a\u3044\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u5b9f\u884c\u3067\u3059\u3002<\/p>\n<pre><strong>php artisan migrate<\/strong><\/pre>\n<p>\u5b9f\u884c\u304c\u5b8c\u4e86\u3059\u308b\u3068\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-3778\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_10.png\" alt=\"\" width=\"360\" height=\"339\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_10.png 360w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_10-300x283.png 300w\" sizes=\"auto, (max-width: 360px) 100vw, 360px\" \/><\/p>\n<p>\u3053\u308c\u3067Laravel\u5074\u306e\u6e96\u5099\u3082\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<h1>SMS\u9001\u4fe1\u3059\u308b\u30b3\u30fc\u30c9\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u3053\u3053\u304b\u3089\u304c\u5b9f\u969b\u306bSMS\u9001\u4fe1\u3059\u308b\u90e8\u5206\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u5192\u982d\u3067\u3082\u66f8\u304d\u307e\u3057\u305f\u304c\u3001SMS\u306fLaravel\u306e<code>Notification<\/code>\u3092\u4f7f\u3063\u3066\u9001\u4fe1\u3057\u307e\u3059\u306e\u3067\u3001\u307e\u305a\u306f\u5c02\u7528\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>php artisan make:notification SmsNotification<\/strong><\/pre>\n<p>\u305d\u3057\u3066\u3001\u4f5c\u6210\u3055\u308c\u305f<code>app\/Notifications\/SmsNotification.php<\/code>\u3092\u958b\u3044\u3066\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002\uff08\u592a\u5b57\u304c\u5909\u66f4\u3001\u8ffd\u52a0\u3057\u305f\u3068\u3053\u308d\u3067\u3059\uff09<\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Notifications;\r\n\r\nuse Illuminate\\Bus\\Queueable;\r\n<strong>use Illuminate\\Notifications\\Messages\\NexmoMessage;<\/strong>\r\nuse Illuminate\\Notifications\\Notification;\r\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\r\nuse Illuminate\\Notifications\\Messages\\MailMessage;\r\n\r\nclass SmsNotification extends Notification\r\n{\r\n    \/\/ \u7701\u7565\r\n\r\n    \/**\r\n     * Get the notification's delivery channels.\r\n     *\r\n     * @param  mixed  $notifiable\r\n     * @return array\r\n     *\/\r\n    <strong>public function via($notifiable)<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        return ['nexmo'];<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n    \/**\r\n     * Get the Nexmo \/ SMS representation of the notification.\r\n     *\r\n     * @param  mixed  $notifiable\r\n     * @return NexmoMessage\r\n     *\/\r\n    <strong>public function toNexmo($notifiable)<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        return (new NexmoMessage())<\/strong>\r\n<strong>            -&gt;content('\u3053\u3093\u306b\u3061\u306f\uff01SMS\u306e\u9001\u4fe1\u30c6\u30b9\u30c8\u3067\u3059\u3002')<\/strong>\r\n<strong>            -&gt;unicode();<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n    \/\/ \u4ee5\u4e0b\u7701\u7565\r\n}<\/pre>\n<h1>\u30c6\u30b9\u30c8\u9001\u4fe1\u3059\u308b<\/h1>\n<p>\u3067\u306f\u3001\u5168\u3066\u306e\u4f5c\u696d\u304c\u5b8c\u4e86\u3057\u305f\u306e\u3067\u30c6\u30b9\u30c8\u3068\u3057\u3066\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u3066<code>SMS<\/code>\u3092\u9001\u4fe1\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\n\/\/ \u7701\u7565\r\n<strong>use App\\Notifications\\SmsNotification;<\/strong>\r\n\r\nclass HomeController extends Controller\r\n{\r\n    public function sms() {\r\n\r\n        <strong>$user = \\App\\User::find(1);<\/strong>\r\n<strong>        $user-&gt;notify(new SmsNotification());<\/strong>\r\n\r\n    }<\/pre>\n<p>\u203b \u9001\u4fe1\u3059\u308b\u30e6\u30fc\u30b6\u30fc\u306e<code>phone_number<\/code>\u306b\uff08\u30a2\u30ab\u30a6\u30f3\u30c8\u767b\u9332\u3057\u305f\uff09\u96fb\u8a71\u756a\u53f7\u304c\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304b\u3089\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002\uff08<strong>\u96fb\u8a71\u756a\u53f7\u306f\u56fd\u756a\u53f781 + \u6700\u521d\u306e\u30bc\u30ed\u3092\u629c\u304b\u3057\u305f\u756a\u53f7\u3067\u3059<\/strong>\uff09<\/p>\n<p>\u203b \u307e\u305f\u3082\u3057\u3001Nexmo\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u304c\u30c8\u30e9\u30a4\u30a2\u30eb\u7248\u306e\u5834\u5408\u3001\u305d\u306e\u4ed6\u306e\u96fb\u8a71\u756a\u53f7\u306b\u9001\u4fe1\u3059\u308b\u5834\u5408\u306f\u30c6\u30b9\u30c8\u756a\u53f7\u767b\u9332\u3092\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u8a73\u3057\u304f\u306f\u3001\u300c\u3061\u306a\u307f\u306b\uff1a\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u96fb\u8a71\u756a\u53f7\u4ee5\u5916\u306b\u9001\u4fe1\u30c6\u30b9\u30c8\u3059\u308b\u306b\u306f\u300d\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u9001\u4fe1\u3055\u308c\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3786\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_14.png\" alt=\"\" width=\"804\" height=\"292\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_14.png 804w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_14-300x109.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_14-768x279.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<p>\u6210\u529f\u3067\u3059\uff01<\/p>\n<h1>\u3061\u306a\u307f\u306b &#8211; 1\uff1a\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u96fb\u8a71\u756a\u53f7\u4ee5\u5916\u306b\u9001\u4fe1\u30c6\u30b9\u30c8\u3059\u308b\u306b\u306f<\/h1>\n<p><code>Nexmo<\/code>\u304c\u30c8\u30e9\u30a4\u30a2\u30eb\u7248\u306e\u5834\u5408\u3001\u30a2\u30ab\u30a6\u30f3\u30c8\u767b\u9332\u3055\u308c\u305f\u96fb\u8a71\u756a\u53f7\u4ee5\u5916\u3078SMS\u9001\u4fe1\u3059\u308b\u305f\u3081\u306b\u306f\u300c\u30c6\u30b9\u30c8\u96fb\u8a71\u756a\u53f7\u300d\u3092\u767b\u9332\u4e8b\u524d\u306b\u767b\u9332\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u624b\u9806\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<p>\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u3068\u753b\u9762\u5de6\u5074\u306e\u30e1\u30cb\u30e5\u30fc\u306b<code>Test numbers<\/code>\u3068\u3044\u3046\u9805\u76ee\u304c\u51fa\u3066\u3044\u308b\u306e\u3067\u3053\u308c\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3781\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_11.png\" alt=\"\" width=\"245\" height=\"366\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_11.png 245w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_11-201x300.png 201w\" sizes=\"auto, (max-width: 245px) 100vw, 245px\" \/><\/p>\n<p>\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u756a\u53f7\u3092\u767b\u9332\u3059\u308b\u30d5\u30a9\u30fc\u30e0\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u30c6\u30b9\u30c8\u7528\u306e\u96fb\u8a71\u756a\u53f7\uff08\u3053\u308c\u3082\u56fd\u969b\u96fb\u8a71\u3068\u540c\u3058\u304f\u6700\u521d\u306e\u30bc\u30ed\u3092\u629c\u304b\u3057\u305f\u756a\u53f7\uff09\u3092\u767b\u9332\u3057\u3066<strong>\u300cAdd\u300d<\/strong>\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3779\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_12.png\" alt=\"\" width=\"455\" height=\"165\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_12.png 455w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_12-300x109.png 300w\" sizes=\"auto, (max-width: 455px) 100vw, 455px\" \/><\/p>\n<p>\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u30a2\u30ab\u30a6\u30f3\u30c8\u306b\u767b\u9332\u3057\u305f\u756a\u53f7\u306bSMS\u3067\u8a8d\u8a3c\u756a\u53f7\u304c\u9001\u4fe1\u3055\u308c\u3066\u304d\u307e\u3059\u306e\u3067\u3001\u305d\u306e\u756a\u53f7\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5165\u529b\u3057\u3066<strong>\u300cVerify\u300d<\/strong>\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3784\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_13.png\" alt=\"\" width=\"623\" height=\"244\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_13.png 623w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/06\/laravel_sms_notification_13-300x117.png 300w\" sizes=\"auto, (max-width: 623px) 100vw, 623px\" \/><\/p>\n<h1>\u3061\u306a\u307f\u306b &#8211; 2\uff1a\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u3055\u308c\u3066\u3044\u306a\u3044\u4eba\u306bSMS\u3092\u9001\u4fe1\u3059\u308b<\/h1>\n<p>\u3082\u3057\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u3055\u308c\u3066\u3044\u306a\u3044\u4eba\u306bSMS\u3092\u9001\u4fe1\u3057\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\uff08\u96fb\u8a71\u756a\u53f7\u306f\u56fd\u756a\u53f7\uff0b\u6700\u521d\u306e\u30bc\u30ed\u3092\u629c\u304b\u3057\u305f\u756a\u53f7\u3067\u3059\uff09<\/p>\n<pre><strong>\\Notification::route('nexmo', '8190********') <\/strong>\/\/ \u96fb\u8a71\u756a\u53f7<strong>\r\n    -&gt;notify(new SmsNotification());<\/strong><\/pre>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f<code>Laravel<\/code>\u304b\u3089\u30b7\u30e7\u30fc\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u65e5\u672c\u3067\u306f\u3042\u307e\u308a<code>SMS<\/code>\u3092\u4f7f\u3063\u3066\u3084\u308a\u3068\u308a\u3092\u3059\u308b\u3053\u3068\u306f\u5c11\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u643a\u5e2f\u756a\u53f7\u304c\u6b63\u3057\u3044\u304b\u3069\u3046\u304b\u3092\u78ba\u304b\u3081\u308b\u624b\u6bb5\u3068\u3057\u3066\u306f\u3068\u3066\u3082\u6709\u52b9\u306a\u6a5f\u80fd\u3068\u8a00\u3063\u3066\u3044\u3044\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u307e\u305f\u3001<code>Nexmo<\/code>\u306f\u30c8\u30e9\u30a4\u30a2\u30eb\u7248\u3082\u3042\u308b\u306e\u3067\u52c9\u5f37\u306e\u305f\u3081\u306b\u5b9f\u884c\u3057\u3066\u307f\u3066\u3082\u3044\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u30c8\u30e9\u30a4\u30a2\u30eb\u3060\u3051\u306a\u3089\u30af\u30ec\u30b8\u30c3\u30c8\u30ab\u30fc\u30c9\u3092\u767b\u9332\u3057\u306a\u304f\u3066\u3082SMS\u9001\u4fe1\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3088\uff01<\/p>\n<p>\u7686\u3055\u3093\u3082\u4e00\u5ea6\u8a66\u3057\u3066\u307f\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2158 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/29.png\" alt=\"\" width=\"170\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/29.png 170w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/29-159x300.png 159w\" sizes=\"auto, (max-width: 170px) 100vw, 170px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001Laravel\u597d\u304d\u306a\u79c1\u304b\u3089\u3059\u308b\u3068\u65b0\u3057\u3044\u6a5f\u80fd\u3084\u4f53\u9a13\u3057\u3066\u3044\u306a\u3044\u6a5f\u80fd\u306f\u6700\u4f4e\uff11\u5ea6\u306f\u4eca\u5f8c\u306e\u958b\u767a\u306e\u305f\u3081\u306b\u89e6\u3063\u3066\u898b\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u305d\u3093\u306a\u4e2d\u3067\u3082\u5c11\u3057\u3060\u3051\u6577\u5c45 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=3764\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel\u3067SMS\uff08\u30b7\u30e7\u30fc\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\uff09\u3092\u9001\u4fe1\u3059\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":3794,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[149],"class_list":["post-3764","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","tag-sms"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/3764","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=3764"}],"version-history":[{"count":10,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/3764\/revisions"}],"predecessor-version":[{"id":3795,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/3764\/revisions\/3795"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/3794"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3764"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3764"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3764"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}