{"id":3545,"date":"2019-04-19T03:42:13","date_gmt":"2019-04-18T18:42:13","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=3545"},"modified":"2019-04-19T03:42:13","modified_gmt":"2019-04-18T18:42:13","slug":"laravel-vue-axios-%e3%81%a7recaptcha%e3%83%90%e3%83%bc%e3%82%b8%e3%83%a7%e3%83%b3%ef%bc%93%e3%82%92%e5%ae%9f%e8%a3%85%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=3545","title":{"rendered":"Laravel + Vue + axios \u3067reCAPTCHA\u30d0\u30fc\u30b8\u30e7\u30f3\uff13\u3092\u5b9f\u88c5\u3059\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001<a href=\"https:\/\/blog.capilano-fw.com\/?p=3531\">\u524d\u56de\u306e\u8a18\u4e8b<\/a>\u3067\u306fAjax\u306b\u95a2\u9023\u3059\u308b\u8a18\u4e8b\u3092\u304a\u5c4a\u3051\u3057\u307e\u3057\u305f\u3002Ajax\u306f\u73fe\u5728\u30a6\u30a7\u30d6\u958b\u767a\u3067\u306f\u672c\u6d41\u3068\u3044\u3063\u3066\u3044\u3044\u307b\u3069\u3088\u304f\u5229\u7528\u3055\u308c\u3066\u3044\u308b\u30c6\u30af\u30cb\u30c3\u30af\u3067\u3059\u304c\u3001HTTP\u9001\u4fe1\u3068\u540c\u3058\u304f\u30c7\u30fc\u30bf\u9001\u4fe1\u3067\u3042\u308b\u3053\u3068\u306b\u306f\u9055\u3044\u304c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u30c7\u30fc\u30bf\u9001\u4fe1\u3059\u308b\u969b\u306b\u5fc5\u305a\u8003\u3048\u3066\u304a\u304b\u306a\u3051\u308c\u3070\u3044\u3051\u306a\u3044\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u308c\u306f\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">\u81ea\u52d5\u30ed\u30dc\u30c3\u30c8\u306b\u3088\u308b\u7121\u5dee\u5225\u306a\u30b9\u30d1\u30e0\u9001\u4fe1<\/strong><\/p>\n<p>\u3067\u3059\u3002<\/p>\n<p>\u3069\u3046\u3044\u3046\u3053\u3068\u304b\u3068\u3044\u3046\u3068\u3001\u30b9\u30d1\u30e0\u3092\u5b9f\u884c\u3059\u308b\u4eba\u305f\u3061\u306e\u6226\u7565\u306e\u3072\u3068\u3064\u306f\u6b21\u306e\u3088\u3046\u306a\u3082\u306e\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u3069\u3053\u304b\u3089\u3067\u3082\u3044\u3044\u306e\u3067\u7121\u5dee\u5225\u306b\u30c7\u30fc\u30bf\u9001\u4fe1\u3059\u308b<\/li>\n<li>\u3082\u3057\u305d\u306e\u9001\u4fe1\u304c\u304a\u554f\u3044\u5408\u308f\u305b\u306a\u3089\u30e1\u30c3\u30bb\u30fc\u30b8\u9001\u4fe1\u3067\u304d\u308b<\/li>\n<li>\u30e1\u30c3\u30bb\u30fc\u30b8\u306b\u81ea\u5206\u306e\u30b5\u30a4\u30c8\u3084\u5e83\u544a\u30ea\u30f3\u30af\u3092\u5165\u308c\u3066\u304a\u304f<\/li>\n<\/ol>\n<p>\u3053\u3046\u3059\u308b\u3053\u3068\u3067\u3001\u6570\u6483\u3061\u3083\u5f53\u305f\u308b\u65b9\u5f0f\u3067\u30a2\u30af\u30bb\u30b9\u3092\u5897\u3084\u305d\u3046\u3092\u3057\u3066\u3044\u308b\u308f\u3051\u3067\u3059\u306d\u3002<\/p>\n<p>\u305f\u3060\u3001\u6b63\u76f4\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u958b\u767a\u3059\u308b\u6211\u3005\u304b\u3089\u3059\u308b\u3068\u3001\u3053\u3046\u3044\u3063\u305f\u7121\u5dee\u5225\u9001\u4fe1\u306f\u300c\u767e\u5bb3\u3042\u3063\u3066\u4e00\u5229\u306a\u3057\u300d\u306a\u306e\u3067\u3001\u3059\u3079\u3066\u906e\u65ad\u3059\u308b\u3053\u3068\u304c\u671b\u307e\u3057\u3044\u3067\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u3088\u304f\u5229\u7528\u3055\u308c\u3066\u3044\u308b\u306e\u304cGoogle\u304c\u63d0\u4f9b\u3059\u308b <a href=\"https:\/\/www.google.com\/recaptcha\/intro\/v3.html\" target=\"_blank\" rel=\"noopener noreferrer\">reCAPTCHA<\/a> \u3067\u3059\u3002<br \/>\n\u4f8b\u306e\u300c\u79c1\u306f\u30ed\u30dc\u30c3\u30c8\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u300d\u3068\u8868\u793a\u3055\u308c\u308b\u3084\u3064\u3067\u3059\u306d\u3002<\/p>\n<p>\u305f\u3060\u3057\u3001\u3053\u306e\u8a18\u4e8b\u3092\u66f8\u3044\u3066\u3044\u308b\u6642\u70b9\u3067\u306f<code>reCAPTCHA<\/code>\u306f\u30d0\u30fc\u30b8\u30e7\u30f3\uff13\u306b\u306a\u308a\u3001\u306a\u3093\u3068<strong>\u4f55\u3082\u3057\u306a\u304f\u3066\u3082\u30ed\u30dc\u30c3\u30c8\u304b\u4eba\u9593\u304b\u306e\u5224\u5225\u3092\u3057\u3066\u304f\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/strong><\/p>\n<p>\u305d\u3053\u3067\uff01<br \/>\n\u4eca\u56de\u306fLaravel + Vue + axios \u306eAjax\u9001\u4fe1\u3067reCAPTCHA\u3092\u4f7f\u3046\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3405 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18.png\" alt=\"\" width=\"310\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18.png 310w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18-291x300.png 291w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/>\u300c\u30b9\u30d1\u30e0\u9001\u4fe1\u3084\u3081\u3066\u307b\u3057\u3044\u30fb\u30fb\u30fb\ud83d\ude2d\u300d<\/p>\n<p>\u958b\u767a\u74b0\u5883\uff1a Laravel 5.8, Vue 2.6, axios 0.18<\/p>\n<h1>reCAPTCHA\u306b\u30b5\u30a4\u30c8\u3092\u767b\u9332\u3059\u308b<\/h1>\n<p>\u307e\u305a\u306fGoogle\u30a2\u30ab\u30a6\u30f3\u30c8\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u4ee5\u4e0b\u306eURL\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.google.com\/recaptcha\/admin\">https:\/\/www.google.com\/recaptcha\/admin<\/a><\/p>\n<p>\u3059\u308b\u3068\u753b\u9762\u53f3\u4e0a\u306b<code>\uff0b<\/code>\u30dc\u30bf\u30f3\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3053\u3053\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u30b5\u30a4\u30c8\u767b\u9332\u306e\u30da\u30fc\u30b8\u3078\u79fb\u52d5\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3552\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/reCAPTCHA_1.png\" alt=\"\" width=\"304\" height=\"126\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/reCAPTCHA_1.png 304w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/reCAPTCHA_1-300x124.png 300w\" sizes=\"auto, (max-width: 304px) 100vw, 304px\" \/><\/p>\n<p>\u79fb\u52d5\u3057\u305f\u3089\u5fc5\u8981\u306a\u9805\u76ee\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li><strong>\u30e9\u30d9\u30eb<\/strong>\u3000\u30fb\u30fb\u30fb\u3000\u30b5\u30a4\u30c8\u3092\u8b58\u5225\u3059\u308b\u30c6\u30ad\u30b9\u30c8\u3002\u304a\u597d\u307f\u3067\u6c7a\u3081\u3066\u3044\u3044\u3067\u3059\u304c\u5f8c\u304b\u3089\u898b\u3066\u308f\u304b\u308a\u3084\u3059\u3044\u3082\u306e\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\u3002\uff08\u4f8b\uff1a\u30b5\u30a4\u30c8\u30c9\u30e1\u30a4\u30f3\u3084\u30b5\u30a4\u30c8\u540d\u306a\u3069\uff09<\/li>\n<li><strong>reCAPTCHA\u30bf\u30a4\u30d7<\/strong>\u3000\u30fb\u30fb\u30fb\u3000\u4eca\u56de\u306f\u30d0\u30fc\u30b8\u30e7\u30f3\uff13\u306e\u8a18\u4e8b\u3067\u3059\u306e\u3067<code>reCAPTCHA v3<\/code>\u3092\u9078\u629e<\/li>\n<li><strong>\u30c9\u30e1\u30a4\u30f3<\/strong>\u3000\u30fb\u30fb\u30fb\u3000reCAPTCHA\u3092\u6709\u52b9\u306b\u3059\u308b\u30c9\u30e1\u30a4\u30f3\u3002\u8907\u6570\u6307\u5b9a\u3067\u304d\u307e\u3059\u304c\u3001\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3068\u30b5\u30fc\u30d0\u30fc\u74b0\u5883\u306f\u5206\u3051\u308b\u3079\u304d\u3068\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/li>\n<li><strong>\u5229\u7528\u6761\u4ef6<\/strong>\u3000\u30fb\u30fb\u30fb\u3000\u540c\u610f\u3059\u308b<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3551\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/reCAPTCHA_2.png\" alt=\"\" width=\"645\" height=\"630\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/reCAPTCHA_2.png 645w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/reCAPTCHA_2-300x293.png 300w\" sizes=\"auto, (max-width: 645px) 100vw, 645px\" \/><\/p>\n<p>\u5165\u529b\u304c\u7d42\u308f\u3063\u305f\u3089\u30da\u30fc\u30b8\u4e0b\u90e8\u306b\u3042\u308b\u9001\u4fe1\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3550\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/reCAPTCHA_3.png\" alt=\"\" width=\"352\" height=\"115\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/reCAPTCHA_3.png 352w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/reCAPTCHA_3-300x98.png 300w\" sizes=\"auto, (max-width: 352px) 100vw, 352px\" \/><\/p>\n<p>\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306breCAPTCHA\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\uff12\u3064\u306e\u30ad\u30fc\u30b3\u30fc\u30c9\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3549\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/reCAPTCHA_4.png\" alt=\"\" width=\"868\" height=\"385\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/reCAPTCHA_4.png 868w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/reCAPTCHA_4-300x133.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/reCAPTCHA_4-768x341.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<p>\u3053\u306e\uff12\u3064\u306e\u30ad\u30fc\u30b3\u30fc\u30c9\u3092Laravel\u304b\u3089\u3044\u3064\u3067\u3082\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b<code>.env<\/code>\u30d5\u30a1\u30a4\u30eb\u5185\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304d\u8fbc\u3093\u3067\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>RECAPTCHA_SITE_KEY<\/strong>=*********************\r\n<strong>RECAPTCHA_SECRET_KEY<\/strong>=*************************<\/pre>\n<p>\u306f\u3044\uff01<br \/>\n\u3053\u308c\u3067<code>reCAPTCHA<\/code>\u306e\u8a2d\u5b9a\u306f\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<p><strong>\uff08\u3061\u306a\u307f\u306b\uff09<\/strong><\/p>\n<p>\u30ad\u30fc\u30b3\u30fc\u30c9\u3092\u5f8c\u304b\u3089\u78ba\u8a8d\u3057\u305f\u3044\u5834\u5408\u306f\u30da\u30fc\u30b8\u53f3\u4e0a\u306b\u3042\u308b\u30ae\u30a2\u306e\u30de\u30fc\u30af\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3547\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/reCAPTCHA_5.png\" alt=\"\" width=\"286\" height=\"128\" \/><\/p>\n<p>\u3059\u308b\u3068\u3001\u300c<strong>reCAPTCHA\u306e\u30ad\u30fc<\/strong>\u300d\u3068\u3044\u3046\u9805\u76ee\u304c\u3042\u308b\u306e\u3067\u305d\u3053\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3546\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/reCAPTCHA_6.png\" alt=\"\" width=\"809\" height=\"358\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/reCAPTCHA_6.png 809w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/reCAPTCHA_6-300x133.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/reCAPTCHA_6-768x340.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<h1>HTML\u90e8\u5206\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u7d9a\u3044\u3066\u3001HTML\u90e8\u5206\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\n\u307e\u305a\u306f\u5b9f\u969b\u306e\u30b3\u30fc\u30c9\u304b\u3089\u3002<\/p>\n<pre>&lt;html&gt;\r\n&lt;body&gt;\r\n    &lt;div id=\"app\"&gt;\r\n        <strong>&lt;!-- \uff11 --&gt;<\/strong>\r\n<strong>        &lt;button type=\"button\" @click=\"onSubmit\"&gt;\u9001\u4fe1&lt;\/button&gt;<\/strong>\r\n    &lt;\/div&gt;\r\n<strong>    &lt;!-- \uff12 --&gt;<\/strong>\r\n<strong>    &lt;script src=\"https:\/\/www.google.com\/recaptcha\/api.js?render={{ env('RECAPTCHA_SITE_KEY') }}\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>    &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/axios\/0.18.0\/axios.min.js\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>    &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue@2.6.10\/dist\/vue.min.js\"&gt;&lt;\/script&gt;<\/strong>\r\n    &lt;script&gt;\r\n\r\n        new Vue({\r\n            el: '#app',\r\n            data: {\r\n                <strong>\/\/ \uff13<\/strong>\r\n<strong>                params: {<\/strong>\r\n<strong>                    token: ''<\/strong>\r\n<strong>                }<\/strong>\r\n            },\r\n            methods: {\r\n                <strong>onSubmit() {<\/strong>\r\n\r\n<strong>                    axios.post('\/recaptcha_ajax', this.params)<\/strong>\r\n<strong>                        .then((response) =&gt; {<\/strong>\r\n\r\n<strong>                            console.log(response.data)<\/strong>\r\n\r\n<strong>                        })<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n            },\r\n            mounted() {\r\n\r\n                <strong>\/\/ \uff14<\/strong>\r\n<strong>                grecaptcha.ready(() =&gt; {<\/strong>\r\n<strong>                    grecaptcha.execute('{{ env('RECAPTCHA_SITE_KEY') }}', {action: 'homepage'})<\/strong>\r\n<strong>                        .then((token) =&gt; {<\/strong>\r\n\r\n<strong>                            this.params.token = token<\/strong>\r\n\r\n<strong>                        });<\/strong>\r\n<strong>                });<\/strong>\r\n\r\n            }\r\n        })\r\n\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u3084\u3063\u3066\u3044\u308b\u3053\u3068\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<p>\uff11\u3000\u30fb\u30fb\u30fb\u3000\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068Ajax\u9001\u4fe1\u3059\u308b<code>onSubmit()<\/code>\u3068\u3044\u3046\u30a4\u30d9\u30f3\u30c8\u3092\u3064\u3051\u307e\u3059\u3002\u9001\u4fe1\u5185\u5bb9\u306b\u306f<code>reCAPTCHA<\/code>\u304b\u3089\u53d6\u5f97\u3057\u305f\u30c8\u30fc\u30af\u30f3\uff08\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u3088\u3046\u306a\u3082\u306e\uff09\u304c\u542b\u307e\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\uff12\u3000\u30fb\u30fb\u30fb\u3000\u5404\u7a2eJavaScript\u30e9\u30a4\u30d6\u30e9\u30ea\u3092<code>cdn<\/code>\u3067\u8aad\u307f\u8fbc\u3093\u3067\u3044\u307e\u3059\u3002\u4e0a\u304b\u3089\u3001reCAPTCHA\u3001axios\u3001Vue\u3067\u3059\u3002<code>reCAPTCHA<\/code>\u306eURL\u306b\u306f<code>.env<\/code>\u306b\u66f8\u304d\u8fbc\u3093\u3060\u30b5\u30a4\u30c8\u30fb\u30c8\u30fc\u30af\u30f3\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\uff13\u3000\u30fb\u30fb\u30fb\u3000Vue\u306e\u5909\u6570\u3068\u3057\u3066<code>params<\/code>\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002\u3053\u306e\u5909\u6570\u5185\u306e<code>token<\/code>\u306b<code>reCAPTCHA<\/code>\u306e\u30c8\u30fc\u30af\u30f3\u304c\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\uff14\u3000\u30fb\u30fb\u30fb\u3000\u30da\u30fc\u30b8\u306e\u8aad\u307f\u8fbc\u307f\u304c\u5b8c\u4e86\u3057\u305f\u6642\u70b9\u3067<code>reCAPTCHA<\/code>\u304b\u3089\u30c8\u30fc\u30af\u30f3\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<code>grecaptcha.execute()<\/code>\u306b\u3082\u30b5\u30a4\u30c8\u30fb\u30c8\u30fc\u30af\u30f3\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u203b \u4eca\u56de\u306f\u30c6\u30b9\u30c8\u3067\u3059\u306e\u3067\u9001\u4fe1\u30c7\u30fc\u30bf\u3092\u30c8\u30fc\u30af\u30f3\u306e\u307f\u306b\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u5b9f\u969b\u306e\u958b\u767a\u3067\u306f<code>params<\/code>\u5185\u306b\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3084\u30d1\u30b9\u30ef\u30fc\u30c9\u306a\u3069\u306e\u30c7\u30fc\u30bf\u3092\u683c\u7d0d\u3057\u3066\u9001\u4fe1\u3059\u308b\u3068\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u306a\u304a\u3001\u3053\u306e\u30b3\u30fc\u30c9\u3092\u30d6\u30e9\u30a6\u30b6\u3067\u5b9f\u884c\u3059\u308b\u3068\u30da\u30fc\u30b8\u306b\u53f3\u4e0b\u306b<code>reCAPTCHA<\/code>\u306e\u30de\u30fc\u30af\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3554\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-19-02-04-34.png\" alt=\"\" width=\"171\" height=\"148\" \/><\/p>\n<p>\u305d\u3057\u3066\u3001\u30de\u30a6\u30b9\u30ab\u30fc\u30bd\u30eb\u3092\u5408\u308f\u305b\u308b\u3068\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3555\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-19-02-05-35.png\" alt=\"\" width=\"334\" height=\"140\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-19-02-05-35.png 334w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-19-02-05-35-300x126.png 300w\" sizes=\"auto, (max-width: 334px) 100vw, 334px\" \/><\/p>\n<h1>Laravel\u90e8\u5206\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u6700\u5f8c\u306bLaravel\u90e8\u5206\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>\u6e96\u5099<\/h2>\n<p>\u53d6\u5f97\u3057\u305f\u30c8\u30fc\u30af\u30f3\u3092POST\u9001\u4fe1\u3059\u308b\u305f\u3081\u306b\u4fbf\u5229\u306a\u306e\u3067<code>Guzzle<\/code>\u3068\u3044\u3046\u6709\u540d\u306aHTTP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30fb\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>composer require guzzlehttp\/guzzle<\/strong><\/pre>\n<h2>\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb<\/h2>\n<p>\u7d9a\u3044\u3066Ajax\u9001\u4fe1\u3055\u308c\u305f\u3068\u304d\u306b\u5b9f\u884c\u3059\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002\u307e\u305a\u306f\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u72ec\u81ea\u30eb\u30fc\u30eb\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>php artisan make:rule Recaptcha<\/strong><\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068<code>app\/Rules\/Recaptcha.php<\/code>\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u958b\u3044\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Rules;\r\n\r\nuse GuzzleHttp\\Client;\r\nuse Illuminate\\Contracts\\Validation\\Rule;\r\n\r\nclass Recaptcha implements Rule\r\n{\r\n    private $_base_score;\r\n\r\n    \/**\r\n     * Create a new rule instance.\r\n     *\r\n     * @return void\r\n     *\/\r\n    public function __construct($base_score = 0.5)\r\n    {\r\n        <strong>\/\/ \uff11<\/strong>\r\n<strong>        $this-&gt;_base_score = $base_score;<\/strong>\r\n    }\r\n\r\n    \/**\r\n     * Determine if the validation rule passes.\r\n     *\r\n     * @param  string  $attribute\r\n     * @param  mixed  $value\r\n     * @return bool\r\n     *\/\r\n    public function passes($attribute, $value)\r\n    {\r\n        <strong>\/\/ \uff12<\/strong>\r\n<strong>        $client = new Client();<\/strong>\r\n<strong>        $response = $client-&gt;request('POST', 'https:\/\/www.google.com\/recaptcha\/api\/siteverify', [<\/strong>\r\n<strong>            'form_params' =&gt; [<\/strong>\r\n<strong>                'secret' =&gt; env('RECAPTCHA_SECRET_KEY'),<\/strong>\r\n<strong>                'response' =&gt; $value<\/strong>\r\n<strong>            ]<\/strong>\r\n<strong>        ]);<\/strong>\r\n<strong>        $results = json_decode($response-&gt;getBody(), true);<\/strong>\r\n<strong>        return (<\/strong>\r\n<strong>            $results['success'] &amp;&amp;<\/strong>\r\n<strong>            $results['score'] &gt; $this-&gt;_base_score<\/strong>\r\n<strong>        );<\/strong>\r\n    }\r\n\r\n    \/**\r\n     * Get the validation error message.\r\n     *\r\n     * @return string\r\n     *\/\r\n    public function message()\r\n    {\r\n        <strong>\/\/ \uff13<\/strong>\r\n        return '<strong>\u6a5f\u68b0\u7684\u306a\u30a2\u30af\u30bb\u30b9\u3060\u3068\u5224\u5b9a\u3055\u308c\u307e\u3057\u305f\u3002\u30ea\u30ed\u30fc\u30c9\u3057\u3066\u3082\u3046\u4e00\u5ea6\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/strong>';\r\n    }\r\n}<\/pre>\n<p>\u91cd\u8981\u306a\u306e\u306f\u6b21\u306e\uff13\u70b9\u3067\u3059\u3002<\/p>\n<p>\uff11\u3000\u30fb\u30fb\u30fb\u3000\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3067\u300c\u57fa\u6e96\u3068\u306a\u308b\u30b9\u30b3\u30a2\u300d\u3092\u6307\u5b9a\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u30b9\u30b3\u30a2\u3068\u306f\u3001reCAPTCHA\u304c\u300c\u3069\u308c\u304f\u3089\u3044\u6a5f\u68b0\u3058\u3083\u306a\u3044\u3068\u5224\u5225\u3057\u305f\u304b\u300d\u304c\u308f\u304b\u308b\u6570\u5b57\u3067\u30010.0\u301c1.0\u306e\u6570\u5b57\u306b\u306a\u308a\u307e\u3059\u3002\u30b9\u30b3\u30a2\u306e\u826f\u3057\u60aa\u3057\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<li>0.0\u3000\u30fb\u30fb\u30fb\u3000\u307b\u307c\u78ba\u5b9f\u306b\u30ed\u30dc\u30c3\u30c8<\/li>\n<li>0.1 ~ 0.4\u3000\u30fb\u30fb\u30fb\u3000\u7701\u7565<\/li>\n<li>0.5\u3000\u30fb\u30fb\u30fb\u3000\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3002\u3053\u308c\u3088\u308a\u5927\u304d\u3051\u308c\u3070\u4eba\u9593\u3001\u5c0f\u3055\u3051\u308c\u3070\u30ed\u30dc\u30c3\u30c8\u3068\u5224\u5225\u3055\u308c\u305f\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/li>\n<li>0.6 ~ 0.9\u3000\u30fb\u30fb\u30fb\u3000\u7701\u7565<\/li>\n<li>1.0\u3000\u30fb\u30fb\u30fb\u3000\u307b\u307c\u78ba\u5b9f\u306b\u4eba\u9593<\/li>\n<\/ul>\n<p>\uff12\u3000\u30fb\u30fb\u30fb\u3000\u5148\u307b\u3069\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f<code>Guzzle<\/code>\u3092\u4f7f\u3063\u3066\u30c8\u30fc\u30af\u30f3\u3068\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30ad\u30fc\u3092\u540c\u6642\u306b<code>reCAPTCHA<\/code>\u5074\u3078\u9001\u4fe1\u3057\u3001\u5224\u5225\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u304c\u6210\u529f\u3057\u305f\u304b\u3069\u3046\u304b\u3092<code>true<\/code>, <code>false<\/code>\u3067\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<p>\uff13\u3000\u30fb\u30fb\u30fb\u3000\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306b\u5931\u6557\u3057\u305f\u5834\u5408\u306e\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3067\u3059\u3002\u591a\u8a00\u8a9e\u5316\u3057\u3066\u3044\u308b\u306a\u3089<code>lang<\/code>\u5185\u306b\u66f8\u304f\u3079\u304d\u3067\u3059\u304c\u3001\u4eca\u56de\u306f\u30c6\u30b9\u30c8\u306a\u306e\u3067\u76f4\u306b\u66f8\u304d\u8fbc\u3093\u3067\u3044\u307e\u3059\u3002<\/p>\n<h2>\u30d5\u30a9\u30fc\u30e0\u30ea\u30af\u30a8\u30b9\u30c8<\/h2>\n<p>\u3067\u306f\u3001<code>reCAPTCHA<\/code>\u306e\u72ec\u81ea\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3059\u308b\u90e8\u5206\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002\u307e\u305a\u306f\u4ee5\u4e0b\u306eArtisan\u30b3\u30de\u30f3\u30c9\u3067\u30d5\u30a9\u30fc\u30e0\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>php artisan make:request TestRequest<\/strong><\/pre>\n<p>\u4f5c\u6210\u304c\u5b8c\u4e86\u3057\u305f\u3089<code>app\/Http\/Requests\/TestRequest.php<\/code>\u3092\u958b\u3044\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Http\\Requests;\r\n\r\n<strong>use App\\Rules\\Recaptcha;<\/strong>\r\nuse Illuminate\\Foundation\\Http\\FormRequest;\r\n\r\nclass TestRequest extends FormRequest\r\n{\r\n    \/**\r\n     * Determine if the user is authorized to make this request.\r\n     *\r\n     * @return bool\r\n     *\/\r\n    public function authorize()\r\n    {\r\n        <strong>return true;<\/strong>\r\n    }\r\n\r\n    \/**\r\n     * Get the validation rules that apply to the request.\r\n     *\r\n     * @return array\r\n     *\/\r\n    public function rules()\r\n    {\r\n        <strong>$base_score = 0.5;<\/strong>\r\n<strong>        return [<\/strong>\r\n<strong>            'token' =&gt; new Recaptcha($base_score)<\/strong>\r\n<strong>        ];<\/strong>\r\n    }\r\n}<\/pre>\n<p>\u592a\u5b57\u306e\u90e8\u5206\u304c\u5909\u66f4\u3057\u305f\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p>\u91cd\u8981\u306a\u90e8\u5206\u3068\u3057\u3066\u306f\u3001<code>new Recaptcha()<\/code>\u306b\u306f\u5f15\u6570\u3067\u57fa\u6e96\u3068\u306a\u308b\u30b9\u30b3\u30a2\u3092\u6307\u5b9a\u3057\u3066\u3044\u308b\u3068\u3053\u308d\u3067\u3059\u3002\u3064\u307e\u308a\u3001\u3053\u3053\u3067\u304a\u597d\u307f\u306e\u30b9\u30b3\u30a2\u57fa\u6e96\u3092\u6307\u5b9a\u3067\u304d\u308b\u308f\u3051\u3067\u3059\u306d\u3002\uff08\u3061\u306a\u307f\u306b\u7701\u7565\u3059\u308b\u3068\u57fa\u6e96\u30b9\u30b3\u30a2\u306f<code>0.5<\/code>\u306b\u306a\u308a\u307e\u3059\uff09<\/p>\n<p>\u3067\u306f\u3001\u30d5\u30a9\u30fc\u30e0\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u4f5c\u6210\u3082\u5b8c\u4e86\u3057\u307e\u3057\u305f\u306e\u3067\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306b\u8a2d\u7f6e\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>public function recaptcha_ajax(<strong>TestRequest $request<\/strong>) {\r\n\r\n    return [\r\n        'result' =&gt; true\r\n    ];\r\n\r\n}<\/pre>\n<p>\u3053\u308c\u3067\u3001\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u304c\u6210\u529f\u3057\u305f\u3089<code>['result' =&gt; true]<\/code>\u304c<code>axios<\/code>\u306b\u8fd4\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\uff01<\/p>\n<h1>\u554f\u984c\u70b9<\/h1>\n<p>\u4eca\u56de<code>reCAPTCHA v3<\/code>\u3092\u5229\u7528\u3059\u308b\u306b\u3042\u305f\u3063\u3066\uff12\u70b9\u307b\u3069\u554f\u984c\u70b9\u306b\u906d\u9047\u3057\u305f\u306e\u3067\u6700\u5f8c\u306b\u305d\u306e\u89e3\u6c7a\u7b56\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<h2>\u554f\u984c\u70b9\uff11\uff1a\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3059\u3050\u9001\u4fe1\u3067\u304d\u306a\u3044<\/h2>\n<p>\u3064\u307e\u308a\u3001\u307e\u3060<code>reChaptcha<\/code>\u5074\u304b\u3089\u30c8\u30fc\u30af\u30f3\u3092\u53d6\u5f97\u3059\u308b\u524d\u306a\u306e\u306b\u30c7\u30fc\u30bf\u9001\u4fe1\u3055\u308c\u3066\u3057\u307e\u3046\u3068\u3001\u3082\u3061\u308d\u3093\u30c8\u30fc\u30af\u30f3\u306f\u7a7a\u3067\u3059\u304b\u3089\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306f\u5931\u6557\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u56de\u907f\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b<code>v-if<\/code>\u3067\u30c8\u30fc\u30af\u30f3\u304c\u53d6\u5f97\u3055\u308c\u308b\u307e\u3067\u306f\u9001\u4fe1\u30dc\u30bf\u30f3\u3092\u975e\u8868\u793a\u306b\u3057\u3066\u304a\u304f\u304b\u3001\u3082\u3057\u304f\u306f<code>disabled<\/code>\u3092\u5207\u308a\u66ff\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u3068\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<pre>&lt;button type=\"button\" <strong>v-if=\"params.token\"<\/strong> @click=\"onSubmit\"&gt;\u9001\u4fe1&lt;\/button&gt;<\/pre>\n<h2>\u554f\u984c\u70b9\uff12\uff1a\u30c8\u30fc\u30af\u30f3\u306f\u4e00\u56de\u3057\u304b\u4f7f\u3048\u306a\u3044<\/h2>\n<p>\u6b8b\u5ff5\u306a\u304c\u3089\u30c8\u30fc\u30af\u30f3\u304c\u6709\u52b9\u306a\u306e\u306f\uff11\u56de\u3060\u3051\u3067\u3059\u3002<br \/>\n\u305d\u306e\u305f\u3081\u3001\u4e00\u5ea6Ajax\u9001\u4fe1\u3057\u305f\u3089\u518d\u5ea6\u65b0\u3057\u3044\u30c8\u30fc\u30af\u30f3\u3092\u53d6\u5f97\u3057\u306a\u3044\u3068\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u30b3\u30fc\u30c9\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3057\u305f\u3002<\/p>\n<p><strong>(HTML\u90e8\u5206)<\/strong><\/p>\n<pre>&lt;button type=\"button\" <strong>v-if=\"params.token &amp;&amp; !isSubmitting\"<\/strong> @click=\"onSubmit\"&gt;\u9001\u4fe1&lt;\/button&gt;<\/pre>\n<p><strong>\uff08JavaScript\u90e8\u5206\uff09<\/strong><\/p>\n<pre>&lt;script&gt;\r\n\r\n    new Vue({\r\n        el: '#app',\r\n        data: {\r\n            params: {\r\n                token: ''\r\n            },\r\n            isSubmitting: false\r\n        },\r\n        methods: {\r\n            onSubmit() {\r\n\r\n                this.isSubmitting = true;\r\n\r\n                axios.post('\/recaptcha_ajax', this.params)\r\n                    .then((response) =&gt; {\r\n\r\n                        \/\/ \u9001\u4fe1\u6210\u529f\r\n\r\n                    })\r\n                    .catch((error) =&gt; {\r\n\r\n                        \/\/ \u3053\u3053\u3067\u30a8\u30e9\u30fc\u51e6\u7406\r\n\r\n                    })\r\n                    .then(() =&gt; {\r\n\r\n                        \/\/ Ajax\u9001\u4fe1\u5f8c\u5fc5\u305a\u5b9f\u884c\u3059\u308b\r\n                        <strong>this.isSubmitting = false;<\/strong>\r\n<strong>                        this.setRecaptchaToken();<\/strong>\r\n\r\n                    })\r\n\r\n            },\r\n            <strong>setRecaptchaToken() {<\/strong>\r\n\r\n<strong>                grecaptcha.ready(() =&gt; {<\/strong>\r\n<strong>                    grecaptcha.execute('{{ env('RECAPTCHA_SITE_KEY') }}', {action: 'homepage'})<\/strong>\r\n<strong>                        .then((token) =&gt; {<\/strong>\r\n\r\n<strong>                            this.params.token = token<\/strong>\r\n\r\n<strong>                        });<\/strong>\r\n<strong>                });<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n        },\r\n        mounted() {\r\n\r\n            <strong>this.setRecaptchaToken();<\/strong>\r\n\r\n        }\r\n    })\r\n\r\n&lt;\/script&gt;<\/pre>\n<p>\u3084\u3063\u3066\u3044\u308b\u306e\u306f\u3001\u307e\u305a<code>setRecaptchaToken()<\/code>\u3068\u3044\u3046\u30e1\u30bd\u30c3\u30c9\u3092\u3069\u3053\u304b\u3089\u3067\u3082\u30c8\u30fc\u30af\u30f3\u53d6\u5f97\u3092\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u3053\u306e<code>setRecaptchaToken()<\/code>\u306f\u30da\u30fc\u30b8\u8868\u793a\u3055\u308c\u305f\u6642\u3001\u305d\u3057\u3066Ajax\u9001\u4fe1\u304c\u7d42\u308f\u3063\u305f\u6642\u306e\uff12\u30f5\u6240\u3067\u547c\u3073\u51fa\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u30c8\u30fc\u30af\u30f3\u306fAjax\u304c\u9001\u4fe1\u3055\u308c\u308b\u305f\u3073\u306b\u65b0\u3057\u3044\u3082\u306e\u306b\u7f6e\u304d\u63db\u308f\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u304c\u3001\u307e\u3060\u305d\u308c\u3067\u3082\u554f\u984c\u70b9\u304c\u6b8b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u306f\u3001\u9023\u7d9a\u30af\u30ea\u30c3\u30af\u3067\u3059\u3002<\/p>\n<p>Ajax\u9001\u4fe1\u304c\u5b8c\u4e86\u3059\u308b\u524d\u306b\u4f55\u5ea6\u3082\u30af\u30ea\u30c3\u30af\u3055\u308c\u3066\u3057\u307e\u3046\u3068\u3001\u4e00\u56de\u3057\u304b\u4f7f\u3048\u306a\u3044\u30c8\u30fc\u30af\u30f3\u3092\uff12\u56de\u4ee5\u4e0a\u4f7f\u3046\u3053\u3068\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u305f\u3081\u3001\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001<code>isSubmitting<\/code>\u3068\u3044\u3046\u5909\u6570\u3067\u9001\u4fe1\u4e2d\u304b\u3069\u3046\u304b\u3092\u5224\u5225\u3057\u30dc\u30bf\u30f3\u306e\u8868\u793a\uff0f\u975e\u8868\u793a\u3092\u5207\u308a\u66ff\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n<h1>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/h1>\n<p>\u4eca\u56de\u5b9f\u969b\u306b\u958b\u767a\u3057\u305f\u30b3\u30fc\u30c9\u3092\u4ee5\u4e0b\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u203b \u305f\u3060\u3057\u3001<code>.env<\/code>\u306e\u8a2d\u5b9a\u3084\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u3053\u306e\u30da\u30fc\u30b8\u3092\u547c\u3093\u3067\u3054\u81ea\u8eab\u3067\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<a  data-e-Disable-Page-Transition=\"true\" class=\"download-link\" title=\"\" href=\"https:\/\/blog.capilano-fw.com?download=3556&amp;tmstv=1777534536\" rel=\"nofollow\" id=\"download-link-3556\" data-redirect=\"false\" >\n\tLaravel + Vue + axios \u3067reCAPTCHA\u30d0\u30fc\u30b8\u30e7\u30f3\uff13\u3092\u5b9f\u88c5<\/a>\n\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3053\u308c\u307e\u3067reCAPTCHA\u306b\u306f\u305a\u3063\u3068\u304a\u4e16\u8a71\u306b\u306a\u3063\u3066\u304d\u307e\u3057\u305f\u304c\u3001\u4eca\u56de\u306f\u306f\u3058\u3081\u3066\u30d0\u30fc\u30b8\u30e7\u30f3\uff13\u3092\u8a66\u3059\u3053\u3068\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u6b63\u76f4\u306a\u3068\u3053\u308d\u30d0\u30fc\u30b8\u30e7\u30f3\uff12\u306f\u3001\u30af\u30ea\u30c3\u30af\u4e00\u767a\u3067\u3059\u3093\u306a\u308aOK\u306e\u5834\u5408\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u306a\u3093\u305b\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067\u30c6\u30b9\u30c8\u3057\u3066\u308b\u3068\u4f55\u5ea6\u3082\u4f55\u5ea6\u3082\u30c7\u30fc\u30bf\u9001\u4fe1\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u308f\u3051\u3067\u3001\u305d\u3046\u306a\u3063\u3066\u304f\u308b\u3068\u4f8b\u306e\u753b\u50cf\u304c\u5206\u5272\u3055\u308c\u3066\u3044\u3066\u300c\u8eca\u3092\u9078\u3079\u300d\u3068\u304b\u300c\u6a19\u8b58\u3092\u9078\u3079\u300d\u307f\u305f\u3044\u306a\u9078\u629e\u753b\u9762\u304c\u4f55\u5ea6\u3082\u4f55\u5ea6\u3082\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u3001\u30a4\u30e9\u30a4\u30e9\u3055\u305b\u3089\u308c\u305f\u3053\u3068\u304c\u4f55\u5ea6\u3082\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u3046\u8003\u3048\u308b\u3068\u4eca\u56de\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\uff13\u306f\u30e6\u30fc\u30b6\u30fc\u5074\u3067\u4f55\u3082\u3059\u308b\u5fc5\u8981\u304c\u306a\u3044\u306e\u3067\u3068\u3066\u3082\u30e6\u30fc\u30b6\u30d3\u30ea\u30c6\u30a3\u304c\u5411\u4e0a\u3057\u3066\u3044\u308b\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\uff08\u30fb\u30fb\u30fb\u3067\u3082\u3001\u3069\u3093\u306a\u4ed5\u7d44\u307f\u3067\u4eba\u9593\u3068\u30ed\u30dc\u30c3\u30c8\u3092\u5224\u5225\u3057\u3066\u308b\u3093\u3067\u3057\u3087\u3046\u304b\u30fb\u30fb\u30fb\u3084\u3063\u3071\u6a5f\u68b0\u5b66\u7fd2\uff1f\uff1f\uff09<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u4eca\u56de\u306f\u6700\u65b0\u306e<code>reCAPTCHA<\/code>\u306e\u8a71\u984c\u3092\u304a\u5c4a\u3051\u3057\u307e\u3057\u305f\u3002<br \/>\n<span style=\"font-size: 1rem;\">\u7686\u3055\u3093\u306e\u304a\u5f79\u306b\u305f\u3066\u308b\u3068\u5b09\u3057\u3044\u3067\u3059\u3002<\/span><\/p>\n<p>\u3067\u306f\u3067\u306f\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2597 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/15-2.png\" alt=\"\" width=\"275\" height=\"350\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/15-2.png 275w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/15-2-236x300.png 236w\" sizes=\"auto, (max-width: 275px) 100vw, 275px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u524d\u56de\u306e\u8a18\u4e8b\u3067\u306fAjax\u306b\u95a2\u9023\u3059\u308b\u8a18\u4e8b\u3092\u304a\u5c4a\u3051\u3057\u307e\u3057\u305f\u3002Ajax\u306f\u73fe\u5728\u30a6\u30a7\u30d6\u958b\u767a\u3067\u306f\u672c\u6d41\u3068\u3044\u3063\u3066\u3044\u3044\u307b\u3069\u3088\u304f\u5229\u7528\u3055\u308c\u3066\u3044\u308b\u30c6\u30af\u30cb\u30c3\u30af\u3067\u3059\u304c\u3001HTTP\u9001\u4fe1 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=3545\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel + Vue + axios \u3067reCAPTCHA\u30d0\u30fc\u30b8\u30e7\u30f3\uff13\u3092\u5b9f\u88c5\u3059\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":3561,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,12,2,97],"tags":[35,36],"class_list":["post-3545","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","category-vue-js","category-2","category-97","tag-ajax","tag-axios"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/3545","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=3545"}],"version-history":[{"count":5,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/3545\/revisions"}],"predecessor-version":[{"id":3563,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/3545\/revisions\/3563"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/3561"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3545"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3545"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}