{"id":920,"date":"2019-05-28T21:51:22","date_gmt":"2019-05-28T12:51:22","guid":{"rendered":"https:\/\/dennie.tokyo\/it\/?p=920"},"modified":"2022-04-07T18:34:11","modified_gmt":"2022-04-07T09:34:11","slug":"request-get-%e3%82%af%e3%82%a8%e3%83%aa%e3%83%bc%e3%83%91%e3%83%a9%e3%83%a1%e3%83%bc%e3%82%bf%e3%81%ae%e5%8f%97%e3%81%91%e5%8f%96%e3%82%8a-laravel5-8","status":"publish","type":"post","link":"https:\/\/dennie.tokyo\/it\/?p=920","title":{"rendered":"\u3010Laravel\u3011GET \u30ea\u30af\u30a8\u30b9\u30c8  \u30af\u30a8\u30ea\u30fc\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u53d7\u3051\u53d6\u308a"},"content":{"rendered":"\n<p>Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306fHTTP\u3082\u3057\u304f\u306fHTTPS\u306b\u3088\u308a\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u307e\u3059\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u306fweb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3078\u6e21\u3057\u305f\u3044\u5024\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002<br>\u5024\u3092\u6307\u5b9a\u3059\u308b\u65b9\u6cd5\u306f\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u304c\u3001\u4eca\u56de\u306fURL\u3078\u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br>\u30d6\u30e9\u30a6\u30b6\u304b\u3089HTTP\u3082\u3057\u304f\u306fHTTPS\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u4fe1\u3057\u3001\u53d7\u3051\u53d6\u3063\u305f\u5024\u3092\u30d6\u30e9\u30a6\u30b6\u3078\u8868\u793a\u3057\u307e\u3059\u3002<br>\u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3064\u3044\u3066\u306f\u3053\u3061\u3089\u3092\u53c2\u8003\u306b\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u3084\u308a\u305f\u3044\u3053\u3068<\/h1>\n\n\n\n<p>\u30d6\u30e9\u30a6\u30b6\u304b\u3089URL\u3092\u5165\u529b\u3057\u307e\u3059\u3002<br>URL\u306b\u306f\u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br>URL\u306b\u6307\u5b9a\u3057\u305f\u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u5024\u304c\u30d6\u30e9\u30a6\u30b6\u306b\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"420\" src=\"https:\/\/dennie.tokyo\/it\/wp-content\/uploads\/2019\/05\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2019-07-29-7.52.11-2.png\" alt=\"\" class=\"wp-image-1060\" srcset=\"https:\/\/dennie.tokyo\/it\/wp-content\/uploads\/2019\/05\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2019-07-29-7.52.11-2.png 1200w, https:\/\/dennie.tokyo\/it\/wp-content\/uploads\/2019\/05\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2019-07-29-7.52.11-2-300x105.png 300w, https:\/\/dennie.tokyo\/it\/wp-content\/uploads\/2019\/05\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2019-07-29-7.52.11-2-768x269.png 768w, https:\/\/dennie.tokyo\/it\/wp-content\/uploads\/2019\/05\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2019-07-29-7.52.11-2-1024x358.png 1024w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>\u306a\u304a\u3001\u30d6\u30e9\u30a6\u30b6\u304b\u3089URL\u3092\u5165\u529b\u3059\u308b\u3068\u3001\u305d\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306fGET\u30e1\u30bd\u30c3\u30c9\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\u3002<br>\u4eca\u56de\u6307\u5b9a\u3059\u308bURL\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>http:\/\/localhost\/get_request?value=aaa<\/code><\/pre><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">\u524d\u63d0<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">\u30d5\u30a1\u30a4\u30eb\u69cb\u6210<\/h2>\n\n\n\n<p>\u4eca\u56de\u4f7f\u7528\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u69cb\u6210\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th scope=\"col\">\u30d5\u30a1\u30a4\u30eb\u540d<\/th><th scope=\"col\">\u8aac\u660e<\/th><\/tr><tr><td>routes\/web.php<\/td><td>\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0<\/td><\/tr><\/thead><tbody><tr><td>app\/Http\/Controllers\/BasicController.php<\/td><td>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc<\/td><\/tr><tr><td>resources\/views\/home.blade.php<\/td><td>\u30d3\u30e5\u30fc<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\">\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0<\/h1>\n\n\n\n<p>\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-php\" data-file=\"web.php\" data-lang=\"PHP\"><code>Route::get(&#39;\/get_request&#39;, &#39;BasicController@accept&#39;);<\/code><\/pre><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc<\/h1>\n\n\n\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306f\u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u53d6\u5f97\u3057\u3001\u53d6\u5f97\u3057\u305f\u5024\u3092\u30d3\u30e5\u30fc\u3078\u6e21\u3057\u307e\u3059\u3002<br>\u4ee5\u4e0b\u306f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u5185\u5bb9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-php\" data-file=\"BasicController.php\" data-lang=\"PHP\"><code>namespace App\\Http\\Controllers;\n\nuse App\\Http\\Controllers\\Controller;\nuse Illuminate\\Http\\Request;\n\nclass BasicController extends Controller\n{\n\n    public function accept(Request $request) {\n      $value = $request-&gt;input(&#39;value&#39;);\n      return view(&#39;home&#39;)-&gt;with(&#39;val&#39;, $value);\n    }\n\n}<\/code><\/pre><\/div>\n\n\n\n<p>\u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u53d6\u5f97\u306f<strong>10\u884c\u76ee<\/strong>\u3067\u884c\u3063\u3066\u3044\u307e\u3059\u3002<br>\u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u53d6\u5f97\u306b\u306f<strong>Request\u30af\u30e9\u30b9<\/strong>\u306einput\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002input\u30e1\u30bd\u30c3\u30c9\u306e\u7b2c\u4e00\u5f15\u6570\u3078\u3001\u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u30ad\u30fc\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br>\u4eca\u56de\u6307\u5b9a\u3059\u308b\u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u30ad\u30fc\u306f <strong>&#8220;value&#8221;<\/strong> \u3067\u3059\u3002\u3053\u306e\u70ba\u3001input\u30e1\u30bd\u30c3\u30c9\u306e\u7b2c\u4e00\u5f15\u6570\u306b\u306f <strong>&#8220;value&#8221;<\/strong> \u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u53d6\u5f97\u3057\u305f\u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u30d3\u30e5\u30fc\u3078\u6e21\u3059\u51e6\u7406\u306f<strong>11\u884c\u76ee<\/strong>\u3067\u884c\u3063\u3066\u3044\u307e\u3059\u3002<br><strong>view\u95a2\u6570\u306f\u6307\u5b9a\u3055\u308c\u305f\u30d3\u30e5\u30fc\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/strong>view\u95a2\u6570\u306e\u5f15\u6570\u306b\u306f\u30d3\u30e5\u30fc\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002&#8221;.blade.php&#8221;\u3092\u7701\u529b\u3057\u6307\u5b9a\u3057\u3066\u4e0b\u3055\u3044\u3002<br>with\u30e1\u30bd\u30c3\u30c9\u306f\u30d3\u30e5\u30fc\u3078\u5909\u6570\u540d\u3068\u5024\u3092\u6e21\u3057\u307e\u3059\u3002\u7b2c\u4e00\u5f15\u6570\u306f\u5909\u6570\u540d\u3001\u7b2c\u4e8c\u5f15\u6570\u306f\u5024\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u3053\u3046\u3059\u308b\u3068\u3001\u5909\u6570val($val)\u306b\u3001$value\u306e\u5024\u304c\u683c\u7d0d\u3055\u308c\u3001\u30d3\u30e5\u30fc\u5185\u3067\u5909\u6570val($val)\u304c\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u305f\u3001\u4eca\u56de\u306fRequest\u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u70ba\u3001Request\u30af\u30e9\u30b9\u3092\u8aad\u307f\u8fbc\u3080\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br><strong>4\u884c\u76ee<\/strong>\u306e &#8220;use Illuminate\\Http\\Request;&#8221; \u3067 Request\u30af\u30e9\u30b9\u3092\u8aad\u307f\u8fbc\u3093\u3067\u3044\u307e\u3059\u3002Request\u30af\u30e9\u30b9\u306fLaravel\u306e\u30af\u30e9\u30b9\u3067\u3059\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u30d3\u30e5\u30fc<\/h1>\n\n\n\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306einput\u30e1\u30bd\u30c3\u30c9\u306e\u7b2c\u4e00\u5f15\u6570\u306b&#8221;val&#8221;\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u70ba\u3001\u30d3\u30e5\u30fc\u3067$val\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<br>\u30d3\u30e5\u30fc\u3067\u306f$val\u306e\u5024\u3092\u753b\u9762\u306b\u8868\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\" data-file=\"home.blade.php\"><code>&lt;h1&gt;\u5909\u6570\u306e\u5024\u306f\uff1f\uff1f&lt;\/h1&gt;\n{{$val}}<\/code><\/pre><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">\u78ba\u8a8d<\/h1>\n\n\n\n<p>\u305d\u308c\u3067\u306f\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br>\u30d6\u30e9\u30a6\u30b6\u3078\u4ee5\u4e0b\u306eURL\u3092\u5165\u529b\u3059\u308b\u3068\u30d6\u30e9\u30a6\u30b6\u306b &#8220;aaa&#8221; \u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>http:\/\/localhost\/get_request?value=aaa<\/code><\/pre><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">\u6700\u5f8c\u306b<\/h1>\n\n\n\n<p><strong>input\u30e1\u30bd\u30c3\u30c9\u3067\u30ea\u30af\u30a8\u30b9\u30c8\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u5024\u304c\u53d6\u5f97\u3067\u304d\u308b<\/strong>\u3053\u3068\u3092\u899a\u3048\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306fHTTP\u3082\u3057\u304f\u306fHTTPS\u306b\u3088\u308a\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":1319,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-920","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel"],"_links":{"self":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/920","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=920"}],"version-history":[{"count":61,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/920\/revisions"}],"predecessor-version":[{"id":3440,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/920\/revisions\/3440"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/media\/1319"}],"wp:attachment":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}