{"id":1207,"date":"2019-04-23T15:06:00","date_gmt":"2019-04-23T06:06:00","guid":{"rendered":"https:\/\/qol-kk.com\/wp2\/?p=1207"},"modified":"2019-04-23T15:06:26","modified_gmt":"2019-04-23T06:06:26","slug":"post-1207","status":"publish","type":"post","link":"https:\/\/qol-kk.com\/wp2\/blog\/2019\/04\/23\/post-1207\/","title":{"rendered":"Laravel\uff1aView\u306e\u307f\u3060\u3051\u3069\u8907\u5408\u4e3b\u30ad\u30fc\u3092\u56de\u907f\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<h2>Laravel\uff1aView\u306e\u307f\u3060\u3051\u3069\u8907\u5408\u4e3b\u30ad\u30fc\u3092\u56de\u907f\u3059\u308b\u65b9\u6cd5<\/h2>\n<p>\u4ee5\u524d\u306e\u8a18\u4e8b <a href=\"https:\/\/qol-kk.com\/wp2\/blog\/2019\/02\/08\/post-1093\/\">Laravel\uff1a2\u3064\u306e\u30ab\u30e9\u30e0\u304c\u4e00\u81f4\u3059\u308b\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u3057\u305f\u3044 <\/a>\u30672\u3064\u306e\u30ab\u30e9\u30e0\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u306b\u3064\u3044\u3066\u8a18\u8f09\u3057\u307e\u3057\u305f\u3002\u305d\u306e\u4e2d\u3067\u3001Laravel\u3067\u306f\u57fa\u672c\u7684\u306b\u63a8\u5968\u3055\u308c\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u56de\u907f\u3059\u308b\u65b9\u6cd5\u3092\u8003\u3048\u308b\u3068\u307e\u3068\u3081\u307e\u3057\u305f\u3002<\/p>\n<p>\u4eca\u56de\u3082\u305d\u306e\u6d41\u308c\u306e\u8a71\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u304a\u984c\u306f\u524d\u56de\u3068\u307b\u307c\u540c\u3058\u3001\u5546\u54c1\u5206\u985e\u3067\u3042\u308b\u3010\u30ab\u30c6\u30b4\u30ea\u30fc\u3011\u3068\u30e2\u30fc\u30eb\u306e\u3010\u30bf\u30b0\u30b3\u30fc\u30c9\u3011\u3092\u7d10\u3065\u3051\u307e\u3059\u3002<br \/>\n(\u524d\u56de\u306f\u3010\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u3011\u3068\u306e\u7d10\u4ed8\u3051\u3067\u3057\u305f)<\/p>\n<p>\u30bf\u30b0\u306f\u6570\u3082\u591a\u3044\u3057\u5206\u985e\u3082\u8907\u96d1\u3060\u3057\u3001\u4f55\u3088\u308a\u3082\u30e2\u30fc\u30eb\u9593\u3067\u88ab\u308b\u30bf\u30b0\u30b3\u30fc\u30c9\u304c\u3042\u3063\u305f\u308a\u3057\u307e\u3059\u3002<br \/>\n\u306a\u306e\u3067\u3001\u3010\u30ab\u30fc\u30c8ID\u3011\u3068\u3010\u30bf\u30b0\u30b3\u30fc\u30c9(\u914d\u5e03\u3055\u308c\u3066\u3044\u308b\u5024)\u3011\u306e2\u3064\u306e\u5024\u3067\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3057\u306a\u304f\u3066\u306f\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u4eca\u56de\u6b32\u3057\u3044\u306e\u3082\u30d3\u30e5\u30fc\u306e\u307f\u306a\u306e\u30672\u5024\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3092Controller\u5074\u3067\u53d6\u308a\u51fa\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h3>ER\u56f3<\/h3>\n<p>\u30b3\u30cd\u30af\u30bf\u30fc\u306f\u7121\u8336\u82e6\u8336\u3067\u3059\u304c\u3001\u7c21\u5358\u306aER\u56f3\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1210\" data-permalink=\"https:\/\/qol-kk.com\/wp2\/blog\/2019\/04\/23\/post-1207\/erzu\/\" data-orig-file=\"https:\/\/qol-kk.com\/wp2\/wp-content\/uploads\/2019\/04\/erzu.jpg\" data-orig-size=\"788,660\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"erzu\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/qol-kk.com\/wp2\/wp-content\/uploads\/2019\/04\/erzu-300x251.jpg\" data-large-file=\"https:\/\/qol-kk.com\/wp2\/wp-content\/uploads\/2019\/04\/erzu.jpg\" class=\"alignnone size-full wp-image-1210\" src=\"https:\/\/qol-kk.com\/wp2\/wp-content\/uploads\/2019\/04\/erzu.jpg\" alt=\"\" width=\"788\" height=\"660\" srcset=\"https:\/\/qol-kk.com\/wp2\/wp-content\/uploads\/2019\/04\/erzu.jpg 788w, https:\/\/qol-kk.com\/wp2\/wp-content\/uploads\/2019\/04\/erzu-300x251.jpg 300w, https:\/\/qol-kk.com\/wp2\/wp-content\/uploads\/2019\/04\/erzu-768x643.jpg 768w\" sizes=\"auto, (max-width: 788px) 100vw, 788px\" \/><br \/>\n\u3053\u306e\u3046\u3061\u306e\u4e0a\u90e8\u3010\u30bf\u30b0\u95a2\u9023\u3011\u306e[cart_id]\u306f\u30b7\u30b9\u30c6\u30e0\u5185\u306e\u30e2\u30fc\u30ebID\u3001\u3064\u307e\u308a\u697d\u5929\u5e02\u5834\u3084Yahoo\u30b7\u30e7\u30c3\u30d4\u30f3\u30b0\u3092\u533a\u5225\u3059\u308b\u30b3\u30fc\u30c9\u3067\u3059\u3002[tagcode]\u306f\u30e2\u30fc\u30eb\u304b\u3089\u914d\u5e03\u3055\u308c\u305f\u30bf\u30b0\u30b3\u30fc\u30c9[carttaggroupcode]\u3082\u30e2\u30fc\u30eb\u5074\u3067\u7ba1\u7406\u3055\u308c\u3066\u3044\u308b\u30bf\u30b0\u30b0\u30eb\u30fc\u30d7\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<p>\u5358\u7d14\u306btagcode\u3060\u3051\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u7d44\u3093\u3060\u5834\u5408\u3001\u7570\u306a\u308b\u30e2\u30fc\u30eb\u3067\u540c\u3058\u30bf\u30b0\u30b3\u30fc\u30c9\u304c\u5b58\u5728\u3059\u308b\u72b6\u6cc1\u304c\u767a\u751f\u3059\u308b\u3068\u672c\u6765\u62bd\u51fa\u3057\u305f\u3044\u5024\u3068\u7570\u306a\u308b\u5024\u3092\u751f\u3093\u3067\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u70ba\u3001cart_id + tagcode \u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u5fc5\u8981\u306a\u308f\u3051\u3067\u3059\u3002<\/p>\n<h3>\u5b9f\u969b\u306b\u8a18\u8f09\u3057\u305f\u30b3\u30fc\u30c9<\/h3>\n<p>\u25a0Controller<\/p>\n<pre class=\"lang:default decode:true\">$cases = Categorycarttag::where('category_id',$item-&gt;id)-&gt;get();\r\n        foreach($cases as $case)\r\n        {\r\n            $carttags = Carttag::where('cart_id',$case-&gt;cart_id)\r\n                            -&gt;where('tagcode',$case-&gt;tagcode)\r\n                            -&gt;get();\r\n            foreach($carttags as $carttag)\r\n            {\r\n                $categorytags[]=array(\r\n                                'id'=&gt;$case-&gt;id,\r\n                                'tagcode'=&gt;$carttag-&gt;tagcode,\r\n                                'taggroup'=&gt;$carttag-&gt;carttaggroupcode,\r\n                                'classification'=&gt;$carttag-&gt;classification,\r\n                                'tagname'=&gt;$carttag-&gt;name\r\n                            );\r\n             }\r\n        }\r\n....\r\n\r\nreturn view('hogehoge.edit',compact('categorytags'));<\/pre>\n<p>\u25a0View<\/p>\n<pre class=\"lang:default decode:true\">&lt;table class='btn100' id='list'&gt;\r\n    &lt;colgroup&gt;\r\n        &lt;col style='width:25%;'&gt;\r\n        &lt;col style='width:25%;'&gt;\r\n        &lt;col style='width:25%;'&gt;\r\n        &lt;col style='width:25%;'&gt;\r\n    &lt;\/colgroup&gt;\r\n    &lt;tr&gt;\r\n        &lt;th&gt;\u30ab\u30fc\u30c8\u540d&lt;\/th&gt;\r\n        &lt;th&gt;TagCode&lt;\/th&gt;\r\n        &lt;th&gt;\u30bf\u30b0\u30b0\u30eb\u30fc\u30d7&lt;\/th&gt;\r\n        &lt;th&gt;\u30bf\u30b0\u540d&lt;\/th&gt;\r\n    &lt;\/tr&gt;\r\n    @foreach($categorytags as $tag)\r\n        &lt;tr&gt;\r\n             &lt;td&gt;{{$tag['name']}}&lt;\/td&gt;\r\n             &lt;td&gt;{{$tag['tagcode']}}&lt;\/td&gt;\r\n             &lt;td&gt;{{$tag['classification']}}&lt;\/td&gt;\r\n             &lt;td'&gt;{{$tag['tagname']}}&lt;\/td&gt;\r\n        &lt;\/tr&gt;\r\n    @endforeach\r\n&lt;\/table&gt;<\/pre>\n<p>\u5b9f\u969b\u306b\u66f8\u3044\u3066\u3044\u3066\u5d4c\u3063\u305f\u306e\u304cview\u3002\u4f55\u5ea6\u3082\u30a8\u30e9\u30fc\u3068\u6012\u3089\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u539f\u56e0\u306f\u53d6\u308a\u51fa\u3057\u305f\u5024\u306e\u547c\u51fa\u3057\u65b9\u306b\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<div class=\"pointBox\">\n<p>{{$tag-&gt;name}} \u3067\u306f\u53d6\u5f97\u3067\u304d\u306a\u3044<\/p>\n<\/div>\n<p>array\u3067\u4f5c\u6210\u3057\u305f\u5024\u306f\u3010\u914d\u5217\u3011\u3067\u3042\u3063\u3066[$hogehoge-&gt;hogahoga]\u3067\u53d6\u308a\u51fa\u305b\u308b\u306e\u306f\u3010\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3011\u3002<br \/>\n\u8a00\u308f\u308c\u308c\u3070\u300c\u3042\u3041\uff5e\uff5e\uff01\u300d\u3068\u306a\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u3053\u3089\u8fba\u306e\u77e5\u8b58\u304c\u304b\u306a\u308a\u66d6\u6627\u3067\u3057\u305f\u3002<br \/>\n<a href=\"https:\/\/www.google.com\/search?q=php+%E3%82%AA%E3%83%96%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88+%E9%85%8D%E5%88%97+%E9%81%95%E3%81%84&amp;oq=php+%E3%82%AA%E3%83%96%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E3%80%80%E9%85%8D%E5%88%97&amp;aqs=chrome.2.69i57j0l5.4841j0j7&amp;sourceid=chrome&amp;ie=UTF-8\">\u60c5\u5831\u88dc\u5b8c\u306f\u3053\u3061\u3089\u304b\u3089<\/a><\/p>\n<h3>\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u89e3\u8aac<\/h3>\n<p>\u25a0Controller<\/p>\n<p>\u30ab\u30c6\u30b4\u30ea\u306b\u95a2\u9023\u4ed8\u3051\u3057\u305f\u30bf\u30b0\u30b3\u30fc\u30c9\u3092\u8868\u793a\u3057\u305f\u3044\u306e\u3067\u3001\u30ab\u30c6\u30b4\u30ea\u3068\u30bf\u30b0\u30b3\u30fc\u30c9\u3092\u8a18\u8f09\u3057\u305f\u30c6\u30fc\u30d6\u30eb[categorycaarttags]\u306b\u5bfe\u3057Where\u30ab\u30c6\u30b4\u30eaID\u3067\u62bd\u51fa\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u7d50\u679c\u30ab\u30c6\u30b4\u30eaID\u306b\u95a2\u9023\u4ed8\u3051\u3089\u308c\u305f\u30ab\u30fc\u30c8ID\uff06\u30ab\u30fc\u30c8\u30bf\u30b0ID\u3092\u53d6\u308a\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u203b\u3053\u306e\u62bd\u51fa\u7d50\u679c\u304c$cases\u3067\u3059\u3002<\/p>\n<p>$cases\u306b\u306f\u4f8b\u3048\u3070\u3001\u697d\u5929\u5e02\u5834\u306e\u30bf\u30b0\u30b3\u30fc\u30c910440003\u3068\u3044\u3046\u767b\u9332\u304c\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u30bf\u30b0\u306e\u8a73\u7d30\u60c5\u5831\u3092\u8a18\u8f09\u3057\u3066\u3044\u308b\u30c6\u30fc\u30d6\u30eb carttags\u306b\u306f\u3081\u8fbc\u3093\u3067\u3042\u3052\u308c\u3070\u6b32\u3057\u3044\u60c5\u5831\u3092GET\u51fa\u6765\u308b\u306e\u3067\u3001foreach\u3067\u30eb\u30fc\u30d7\u3092\u56de\u3057\u53d6\u5f97\u3057\u305f\u5024\u3092\u914d\u5217\u306b\u62bc\u3057\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u305d\u306e\u5024\u3092View\u3078\u56de\u3057\u307e\u3059\u3002<\/p>\n<p>\u25a0View<\/p>\n<p>\u524d\u8ff0\u306e\u901a\u308a\u3001View\u3067\u306f\u914d\u5217\u3068\u3057\u3066\u5024\u3092\u53d7\u3051\u3068\u308a\u307e\u3059\u3002<br \/>\n\u305d\u306e\u70ba\u3001\u5024\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306b\u306f{{$tag-&gt;name}}\u3067\u306f\u306a\u304f{{$tag['name']}}\u3068\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<h3>\u307e\u3068\u3081<\/h3>\n<p>\u5f8c\u306f\u5176\u3005\u306e\u5909\u66f4\u3092\u884c\u3046EDIT\u3078\u30af\u30ea\u30c3\u30af\u30a2\u30af\u30b7\u30e7\u30f3\u306a\u3069\u3067\u98db\u3070\u3057\u3066\u3042\u3052\u308c\u3070OK\u3002<\/p>\n<p>\u591a\u5c11\u56de\u308a\u9053\u306b\u306a\u3063\u3066\u3082\u8907\u5408\u4e3b\u30ad\u30fc\u3092\u4f7f\u308f\u305a\u8868\u73fe\u3059\u308b\u4e8b\u306f\u3084\u306f\u308a\u3067\u304d\u308b\u307f\u305f\u3044\u3067\u3059\u306d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Laravel\uff1aView\u306e\u307f\u3060\u3051\u3069\u8907\u5408\u4e3b\u30ad\u30fc\u3092\u56de\u907f\u3059\u308b\u65b9\u6cd5 \u4ee5\u524d\u306e\u8a18\u4e8b Laravel\uff1a2\u3064\u306e\u30ab\u30e9\u30e0\u304c\u4e00\u81f4\u3059\u308b\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u3057\u305f\u3044 \u30672\u3064\u306e\u30ab\u30e9\u30e0\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u306b\u3064\u3044\u3066\u8a18\u8f09\u3057\u307e\u3057\u305f\u3002\u305d\u306e\u4e2d\u3067\u3001Laravel\u3067\u306f\u57fa\u672c\u7684\u306b\u63a8 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":944,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"vkexunit_cta_each_option":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[34],"tags":[54,153,99,98,97,53,45],"class_list":["post-1207","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php-memorandum","tag-html","tag-laravel","tag-mysql","tag-php","tag-97","tag-53","tag-45"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/qol-kk.com\/wp2\/wp-content\/uploads\/2018\/11\/laravel_logo.png","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts\/1207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/comments?post=1207"}],"version-history":[{"count":0,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts\/1207\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/media\/944"}],"wp:attachment":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/media?parent=1207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/categories?post=1207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/tags?post=1207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}