{"id":1100,"date":"2024-04-04T22:10:38","date_gmt":"2024-04-04T13:10:38","guid":{"rendered":"https:\/\/shinke1987.net\/?p=1100"},"modified":"2024-04-08T10:56:02","modified_gmt":"2024-04-08T01:56:02","slug":"laravel%e3%81%a7%e3%81%ae%e3%83%aa%e3%82%af%e3%82%a8%e3%82%b9%e3%83%88%e3%81%ab%e5%af%be%e3%81%99%e3%82%8b%e3%83%ac%e3%83%bc%e3%83%88%e5%88%b6%e9%99%90","status":"publish","type":"post","link":"https:\/\/shinke1987.net\/?p=1100","title":{"rendered":"Laravel\u3067\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u5bfe\u3059\u308b\u30ec\u30fc\u30c8\u5236\u9650"},"content":{"rendered":"\n<h2 id=\"toc0\" class=\"wp-block-heading\">\u76ee\u7684<\/h2>\n\n\n\n<p>\u7279\u5b9a\u306e\u753b\u9762\u3084API\u3078\u306eHTTP\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u30ec\u30fc\u30c8\u5236\u9650\u3092\u8a2d\u3051\u305f\u3044\u3002<\/p>\n\n\n\n<p>\u3088\u308a\u5177\u4f53\u7684\u306b\u8a00\u3046\u3068\u3001\u30ed\u30b0\u30a4\u30f3API\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3067\u304d\u308b\u306e\u306f\u3001IP\u30a2\u30c9\u30ec\u30b91\u500b\u306b\u3064\u304d1\u5206\u9593\u306b3\u56de\u307e\u3067\u3068\u3057\u3001<br>\u305d\u308c\u3092\u8d85\u3048\u305f\u3089HTTP\u30ec\u30b9\u30dd\u30f3\u30b9\u30b3\u30fc\u30c9429\u3092\u8fd4\u3059\u3088\u3046\u306b\u3057\u305f\u3044\u3002<\/p>\n\n\n\n<h2 id=\"toc1\" class=\"wp-block-heading\">\u7de8\u96c6\u3059\u308b\u30d5\u30a1\u30a4\u30eb<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>app\/Providers\/RouteServiceProvider.php<\/li>\n\n\n\n<li>routes\/web.php<\/li>\n<\/ul>\n\n\n\n<h2 id=\"toc2\" class=\"wp-block-heading\">RouteServiceProvider.php<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\npublic function boot(): void\n{\n    RateLimiter::for(&#039;login&#039;, function(Request $request) {\n        return Limit::perMinute(3)-&gt;by($request-&gt;ip());\n    });\n}\n<\/pre><\/div>\n\n\n<h2 id=\"toc3\" class=\"wp-block-heading\">web.php<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n\/\/ \u8a8d\u8a3c\u6e08\u307f\u3067\u306a\u3044\u5834\u5408\u3002\nRoute::group(&#x5B;\n    &#039;middleware&#039; =&gt; &#039;guest&#039;,\n    &#039;controller&#039; =&gt; LoginController::class\n], function () {\n    \/\/ \u30ed\u30b0\u30a4\u30f3\u753b\u9762\u3002\n    Route::get(&#039;\/login&#039;, &#039;showLogin&#039;)-&gt;name(&#039;login&#039;);\n\n    \/\/ \u30ed\u30b0\u30a4\u30f3API\u3002\n    Route::post(&#039;\/auth&#039;, &#039;auth&#039;)-&gt;name(&#039;auth&#039;)\n        -&gt;middleware(&#039;throttle:login&#039;);\n});\n<\/pre><\/div>\n\n\n<h2 id=\"toc4\" class=\"wp-block-heading\">\u78ba\u8a8d<\/h2>\n\n\n\n<p>\u3053\u308c\u3067\u30ed\u30b0\u30a4\u30f3API\u30781\u5206\u9593\u306b4\u56de\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001429\u306eHTTP\u30ec\u30b9\u30dd\u30f3\u30b9\u30b3\u30fc\u30c9\u304c\u8fd4\u3063\u3066\u304f\u308b\u3002<\/p>\n\n\n\n<p>1\u5206\u9593\u7d4c\u904e\u5f8c\u3001\u518d\u5ea6\u30ed\u30b0\u30a4\u30f3API\u3078\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n\n\n\n<p>\u5f8c\u306f\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u9577\u3055\u3092\u9069\u5207\u306a\u3082\u306e\u306b\u3057\u305f\u308a\u3059\u308c\u3070\u3001<br>\u30d6\u30eb\u30fc\u30c8\u30d5\u30a9\u30fc\u30b9\u30a2\u30bf\u30c3\u30af\u5bfe\u7b56\u3068\u3057\u3066\u306f\u3053\u308c\u3067\u5341\u5206\u3060\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 id=\"toc5\" class=\"wp-block-heading\">HTTP\u30ec\u30b9\u30dd\u30f3\u30b9\u30d8\u30c3\u30c0\u306e\u4e0b\u8a18\u9805\u76ee\u3092\u78ba\u8a8d\u3057\u3066\u3082\u826f\u3044<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>X-Ratelimit-Limit\u30ec\u30fc\u30c8\u5236\u9650\u304c\u304b\u304b\u3089\u306a\u3044\u30ea\u30af\u30a8\u30b9\u30c8\u6570\u3002\uff08\u3053\u306e\u5024\u3092\u8d85\u3048\u308b\u3068\u30ec\u30fc\u30c8\u5236\u9650\u304c\u304b\u304b\u308b\uff09<\/li>\n\n\n\n<li>X-Ratelimit-Remaining\u30ec\u30fc\u30c8\u5236\u9650\u304c\u304b\u304b\u308b\u307e\u3067\u306e\u3001\u6b8b\u308a\u30ea\u30af\u30a8\u30b9\u30c8\u6570\u3002\uff08\u3053\u306e\u5024\u304c0\u306b\u306a\u308b\u3068\u30ec\u30fc\u30c8\u5236\u9650\u304c\u304b\u304b\u3063\u3066\u3044\u308b\uff09<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u7684 \u7279\u5b9a\u306e\u753b\u9762\u3084API\u3078\u306eHTTP\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u30ec\u30fc\u30c8\u5236\u9650\u3092\u8a2d\u3051\u305f\u3044\u3002 \u3088\u308a\u5177\u4f53\u7684\u306b\u8a00\u3046\u3068\u3001\u30ed\u30b0\u30a4\u30f3API\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3067\u304d\u308b\u306e\u306f\u3001IP\u30a2\u30c9\u30ec\u30b91\u500b\u306b\u3064\u304d1\u5206\u9593\u306b3\u56de\u307e\u3067\u3068\u3057\u3001\u305d\u308c\u3092\u8d85\u3048\u305f\u3089HTTP\u30ec\u30b9\u30dd\u30f3\u30b9\u30b3\u30fc\u30c9429\u3092 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[96],"tags":[88,81],"class_list":["post-1100","post","type-post","status-publish","format-standard","hentry","category-laravel","tag-laravel","tag-php"],"_links":{"self":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/1100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1100"}],"version-history":[{"count":3,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/1100\/revisions"}],"predecessor-version":[{"id":1108,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/1100\/revisions\/1108"}],"wp:attachment":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}