{"id":4602,"date":"2020-11-23T09:05:52","date_gmt":"2020-11-23T00:05:52","guid":{"rendered":"https:\/\/taki-lab.site\/bocci\/?p=4602"},"modified":"2020-11-23T09:05:55","modified_gmt":"2020-11-23T00:05:55","slug":"%e3%80%90%e3%83%80%e3%82%a4%e3%82%a8%e3%83%83%e3%83%88%e6%94%af%e6%8f%b4%e3%80%91%e3%80%90%e5%85%a5%e5%8a%9b%e5%b1%a5%e6%ad%b4%e6%a9%9f%e8%83%bd%e3%80%91%e5%b1%a5%e6%ad%b4%e3%81%8b%e3%82%89%e3%83%87","status":"publish","type":"post","link":"https:\/\/taki-lab.site\/bocci\/?p=4602","title":{"rendered":"\u3010\u30c0\u30a4\u30a8\u30c3\u30c8\u652f\u63f4\u3011\u3010\u5165\u529b\u5c65\u6b74\u6a5f\u80fd\u3011\u5c65\u6b74\u304b\u3089\u30c7\u30fc\u30bf\u3092\u5165\u529b"},"content":{"rendered":"\n<figure class=\"wp-block-embed-wordpress wp-block-embed is-type-wp-embed is-provider-\u81ea\u5206\u3001\u307c\u3063\u3061\u3067\u3059\u304c\u4f55\u304b\uff1f\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"vPnKRiE2q2\"><a href=\"https:\/\/taki-lab.site\/bocci\/?p=4567\">\u3010\u30c0\u30a4\u30a8\u30c3\u30c8\u652f\u63f4\u3011\u3010\u5165\u529b\u5c65\u6b74\u6a5f\u80fd\u3011\u5c65\u6b74\u691c\u7d22\u3057\u3066\u5019\u88dc\u306e\u8868\u793a<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;\u3010\u30c0\u30a4\u30a8\u30c3\u30c8\u652f\u63f4\u3011\u3010\u5165\u529b\u5c65\u6b74\u6a5f\u80fd\u3011\u5c65\u6b74\u691c\u7d22\u3057\u3066\u5019\u88dc\u306e\u8868\u793a&#8221; &#8212; \u81ea\u5206\u3001\u307c\u3063\u3061\u3067\u3059\u304c\u4f55\u304b\uff1f\" src=\"https:\/\/taki-lab.site\/bocci\/?p=4567&#038;embed=true#?secret=i2K7tqlbVs#?secret=vPnKRiE2q2\" data-secret=\"vPnKRiE2q2\" width=\"474\" height=\"267\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/11\/20201123084136.mp4\"><\/video><\/figure>\n\n\n\n<p>\u306a\u304b\u306a\u304b\u3044\u3044\u611f\u3058\u306b\u4ed5\u4e0a\u304c\u3063\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    public function searchKeyword($keyword, $user)\n    {\n        $result = &#91;];\n        $records1 = EatingTemplateItem::where('item', 'like', \"%$keyword%\")->get();\n        $records2 = $user->EatingHistoryItems()->where('item', 'like', \"%$keyword%\")->get();\n        if(count($records1) + count($records2) >= 10 )\n        {\n            return &#91;];\n        }\n        foreach($records1 as $record)\n        {\n            $obj = new \\stdClass();\n            foreach($this->templateParamNames as $paramName)\n            {\n                $obj->$paramName = $record->$paramName;\n            }\n            $result&#91;] = $obj;\n        }\n        foreach($records2 as $record)\n        {\n            $obj = new \\stdClass();\n            foreach($this->templateParamNames as $paramName)\n            {\n                $obj->$paramName = $record->$paramName;\n            }\n            $result&#91;] = $obj;\n        }\n        return $result;\n    }\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>        onChangeItem: function() {\n            if(this.contents.item!=\"\"){\n                var flg = this.setTemplete();\n                if(flg == false) {\n                    var self = this;\n                    this.param.contents = this.contents;\n                    axios.post('\/api\/eating\/search', this.param).then(function(response){\n                        self.keywords = &#91;];\n                        response.data.keywords.forEach(keyword => {\n                            self.keywords.push(keyword);\n                        });\n                    }).catch(function(error){\n                        self.error_flg = true;\n                        self.errors = error.response.data.errors;\n                    });\n                }\n            }else{\n                this.keywords = &#91;];\n            }\n        },\n        setTemplete: function() {\n            for (var index = 0; index &lt; this.keywords.length; index++) {\n                if(this.keywords&#91;index].item == this.contents.item) {\n                    this.contents.protein = this.keywords&#91;index].protein;\n                    this.contents.liqid = this.keywords&#91;index].liqid;\n                    this.contents.carbo = this.keywords&#91;index].carbo;\n                    this.contents.calorie = this.keywords&#91;index].calorie;\n                    return true;\n                }\n            }\n            return false;\n        }\n<\/code><\/pre>\n\n\n\n<p>\u3053\u308c\u3067\u5165\u529b\u5c65\u6b74\u304b\u3089\u30c7\u30fc\u30bf\u306e\u5165\u529b\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3064\u3044\u3067\u306b\u540c\u3058\u30c7\u30fc\u30bf\u304c\u4e8c\u91cd\u3067\u5c65\u6b74\u306b\u767b\u9332\u3055\u308c\u306a\u3044\u3088\u3046\u306b\u7d30\u5de5\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    \/**\n     * \u30d2\u30b9\u30c8\u30ea\u306b\u30c7\u30fc\u30bf\u3092\uff11\u4ef6\u8ffd\u52a0\u3059\u308b\n     *\/\n    public function addHistory($param, $user)\n    {\n        $record = $this->searchKeyword($param&#91;\"item\"], $user);\n        if(count($record) != 0)\n        {\n            return;\n        }\n        $model = new EatingHistoryItem();\n        foreach($this->templateParamNames as $name)\n        {\n            $model->$name = $param&#91;$name];\n        }\n        $model->save();\n\n        $this->attachToUser($model, $user);\n    }\n<\/code><\/pre>\n\n\n\n<p>\u3053\u308c\u3067\u3042\u308b\u7a0b\u5ea6\u5229\u4fbf\u6027\u304c\u9ad8\u307e\u308a\u307e\u3057\u305f\u306d\u3002<\/p>\n\n\n\n<p>\u3042\u3068\u306f\u7ba1\u7406\u753b\u9762\u304b\u30fb\u30fb\u30fb\u3002<\/p>\n\n\n\n<p>\u4ed6\u306e\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u7ba1\u7406\u753b\u9762\u3092\u8868\u793a\u3067\u304d\u306a\u3044\u3088\u3046\u306b\u3057\u306a\u3044\u3068\u3002<\/p>\n\n\n\n<a href=\"\/\/blog.with2.net\/link\/?2023426:1010\" target=\"_blank\" rel=\"noopener noreferrer\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/03a6eee54039f74ded0b8f7548b1868f.png?w=474\" title=\"\u30d1\u30bd\u30b3\u30f3\u30e9\u30f3\u30ad\u30f3\u30b0\"><\/a>\n\n","protected":false},"excerpt":{"rendered":"<p>\u306a\u304b\u306a\u304b\u3044\u3044\u611f\u3058\u306b\u4ed5\u4e0a\u304c\u3063\u3066\u304a\u308a\u307e\u3059\u3002 \u3053\u308c\u3067\u5165\u529b\u5c65\u6b74\u304b\u3089\u30c7\u30fc\u30bf\u306e\u5165\u529b\u304c\u3067\u304d\u307e\u3057\u305f\u3002 \u3064\u3044\u3067\u306b\u540c\u3058\u30c7\u30fc\u30bf\u304c\u4e8c\u91cd\u3067\u5c65\u6b74\u306b\u767b\u9332\u3055\u308c\u306a\u3044\u3088\u3046\u306b\u7d30\u5de5\u3057\u307e\u3059\u3002 \u3053\u308c\u3067\u3042\u308b\u7a0b\u5ea6\u5229\u4fbf\u6027\u304c\u9ad8\u307e\u308a\u307e\u3057\u305f\u306d\u3002 \u3042\u3068\u306f\u7ba1\u7406\u753b\u9762\u304b\u30fb\u30fb\u30fb\u3002 \u4ed6\u306e &hellip; <a href=\"https:\/\/taki-lab.site\/bocci\/?p=4602\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u3010\u30c0\u30a4\u30a8\u30c3\u30c8\u652f\u63f4\u3011\u3010\u5165\u529b\u5c65\u6b74\u6a5f\u80fd\u3011\u5c65\u6b74\u304b\u3089\u30c7\u30fc\u30bf\u3092\u5165\u529b<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"\u3010\u30c0\u30a4\u30a8\u30c3\u30c8\u652f\u63f4\u3011\u3010\u5165\u529b\u5c65\u6b74\u6a5f\u80fd\u3011\u5c65\u6b74\u304b\u3089\u30c7\u30fc\u30bf\u3092\u5165\u529b\n#TechCommit\n","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[167,3],"tags":[193],"class_list":["post-4602","post","type-post","status-publish","format-standard","hentry","category-laravel","category-3","tag-193"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8SDbY-1ce","jetpack-related-posts":[{"id":4567,"url":"https:\/\/taki-lab.site\/bocci\/?p=4567","url_meta":{"origin":4602,"position":0},"title":"\u3010\u30c0\u30a4\u30a8\u30c3\u30c8\u652f\u63f4\u3011\u3010\u5165\u529b\u5c65\u6b74\u6a5f\u80fd\u3011\u5c65\u6b74\u691c\u7d22\u3057\u3066\u5019\u88dc\u306e\u8868\u793a","author":"taki","date":"2020\u5e7411\u670816\u65e5","format":false,"excerpt":"https:\/\/taki-lab.site\/bocci\/?p=4504 \u3046\u307e\u304f\u30b9\u30af\u30b7\u30e7\u304c\u53d6\u308c\u306a\u304b\u3063\u305f\u2026","rel":"","context":"Laravel","block_context":{"text":"Laravel","link":"https:\/\/taki-lab.site\/bocci\/?cat=167"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4180,"url":"https:\/\/taki-lab.site\/bocci\/?p=4180","url_meta":{"origin":4602,"position":1},"title":"\u3010\u30c0\u30a4\u30a8\u30c3\u30c8\u652f\u63f4\u3011\u4eca\u5f8c\u306e\u6a5f\u80fd\u8ffd\u52a0\u306b\u3064\u3044\u3066","author":"taki","date":"2020\u5e749\u670823\u65e5","format":false,"excerpt":"https:\/\/taki-lab.site\/bocci\/?p=4119 \u4e00\u901a\u308a\u98df\u4e8b\u7ba1\u7406\u6a5f\u80fd\u306f\u5b8c\u6210\u3057\u305f\u2026","rel":"","context":"Laravel","block_context":{"text":"Laravel","link":"https:\/\/taki-lab.site\/bocci\/?cat=167"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/09\/Screenshot-from-2020-09-23-07-31-47.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/09\/Screenshot-from-2020-09-23-07-31-47.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/09\/Screenshot-from-2020-09-23-07-31-47.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/09\/Screenshot-from-2020-09-23-07-31-47.png?resize=700%2C400 2x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/09\/Screenshot-from-2020-09-23-07-31-47.png?resize=1050%2C600 3x"},"classes":[]},{"id":4346,"url":"https:\/\/taki-lab.site\/bocci\/?p=4346","url_meta":{"origin":4602,"position":2},"title":"\u3010\u30c0\u30a4\u30a8\u30c3\u30c8\u652f\u63f4\u3011\u3010\u5165\u529b\u5c65\u6b74\u6a5f\u80fd\u3011\u5165\u529b\u5c65\u6b74\u306b\u30c7\u30fc\u30bf\u3092\u8a18\u5165","author":"taki","date":"2020\u5e7410\u670814\u65e5","format":false,"excerpt":"https:\/\/taki-lab.site\/bocci\/?p=4273 \u3053\u3053\u3082\u30b5\u30af\u30c3\u3068\u4f5c\u6210\u3067\u304d\u308b\u3068\u601d\u2026","rel":"","context":"Laravel","block_context":{"text":"Laravel","link":"https:\/\/taki-lab.site\/bocci\/?cat=167"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4454,"url":"https:\/\/taki-lab.site\/bocci\/?p=4454","url_meta":{"origin":4602,"position":3},"title":"\u3010\u30c0\u30a4\u30a8\u30c3\u30c8\u652f\u63f4\u3011\u3010\u5165\u529b\u5c65\u6b74\u6a5f\u80fd\u3011\u5c65\u6b74\u7ba1\u7406\u753b\u9762\u306e\u4f5c\u6210","author":"taki","date":"2020\u5e7411\u67081\u65e5","format":false,"excerpt":"https:\/\/taki-lab.site\/bocci\/?p=4346 \u7279\u306b\u7279\u7b46\u3059\u308b\u3053\u3068\u306f\u3084\u3063\u3066\u3044\u306a\u2026","rel":"","context":"Laravel","block_context":{"text":"Laravel","link":"https:\/\/taki-lab.site\/bocci\/?cat=167"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/11\/146aa2bedc0e543ec56ae78a911ffc1c.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/11\/146aa2bedc0e543ec56ae78a911ffc1c.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/11\/146aa2bedc0e543ec56ae78a911ffc1c.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/11\/146aa2bedc0e543ec56ae78a911ffc1c.png?resize=700%2C400 2x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/11\/146aa2bedc0e543ec56ae78a911ffc1c.png?resize=1050%2C600 3x"},"classes":[]},{"id":4694,"url":"https:\/\/taki-lab.site\/bocci\/?p=4694","url_meta":{"origin":4602,"position":4},"title":"\u3010\u30c0\u30a4\u30a8\u30c3\u30c8\u652f\u63f4\u3011\u6700\u65b0\u7248\u3092\u30c7\u30d7\u30ed\u30a4\u3057\u307e\u3057\u305f\u3002","author":"taki","date":"2020\u5e7412\u670811\u65e5","format":false,"excerpt":"https:\/\/taki-lab.site:8443\/ \u30dd\u30fc\u30c8\u756a\u53f7\u306e\u8a2d\u5b9a\u3082\u4fee\u6b63\u3057\u305f\u306e\u3067\u3001\u4f7f\u7528\u3067\u304d\u308b\u306f\u2026","rel":"","context":"Laravel","block_context":{"text":"Laravel","link":"https:\/\/taki-lab.site\/bocci\/?cat=167"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4504,"url":"https:\/\/taki-lab.site\/bocci\/?p=4504","url_meta":{"origin":4602,"position":5},"title":"\u3010\u30c0\u30a4\u30a8\u30c3\u30c8\u652f\u63f4\u3011\u3010\u5165\u529b\u5c65\u6b74\u6a5f\u80fd\u3011\u5c65\u6b74\u30c7\u30fc\u30bf\u51e6\u7406\u306e\u4f5c\u6210","author":"taki","date":"2020\u5e7411\u67089\u65e5","format":false,"excerpt":"https:\/\/taki-lab.site\/bocci\/?p=4454 \u524d\u56de\u4f5c\u6210\u3057\u305f\u5c65\u6b74\u4e00\u89a7\u753b\u9762\u304b\u3089\u2026","rel":"","context":"Laravel","block_context":{"text":"Laravel","link":"https:\/\/taki-lab.site\/bocci\/?cat=167"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/11\/afdcf388f2b389ee826cac9883b7ceec.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/11\/afdcf388f2b389ee826cac9883b7ceec.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/11\/afdcf388f2b389ee826cac9883b7ceec.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/11\/afdcf388f2b389ee826cac9883b7ceec.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/11\/afdcf388f2b389ee826cac9883b7ceec.png?resize=1050%2C600&ssl=1 3x"},"classes":[]}],"jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts\/4602","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4602"}],"version-history":[{"count":2,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts\/4602\/revisions"}],"predecessor-version":[{"id":4605,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts\/4602\/revisions\/4605"}],"wp:attachment":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}