{"id":2145,"date":"2020-01-15T12:26:56","date_gmt":"2020-01-15T03:26:56","guid":{"rendered":"http:\/\/taki-lab.site\/bocci\/?p=2145"},"modified":"2020-01-15T12:26:58","modified_gmt":"2020-01-15T03:26:58","slug":"%e3%80%90laravel%e3%80%91%e3%80%90%e3%83%9b%e3%83%86%e3%83%ab%e4%ba%88%e7%b4%84%e7%ae%a1%e7%90%86%e3%80%91%e7%ae%a1%e7%90%86%e8%80%85%e7%94%bb%e9%9d%a2%e3%81%ae%e4%bf%ae%e6%ad%a3","status":"publish","type":"post","link":"https:\/\/taki-lab.site\/bocci\/?p=2145","title":{"rendered":"\u3010Laravel\u3011\u3010\u30db\u30c6\u30eb\u4e88\u7d04\u7ba1\u7406\u3011\u7ba1\u7406\u8005\u753b\u9762\u306e\u4fee\u6b63"},"content":{"rendered":"\n<p>\u524d\u56de\u307e\u3067\u306e\u72b6\u6cc1\u306f\u3053\u3061\u3089<\/p>\n\n\n\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=\"6mOjjoKfjH\"><a href=\"https:\/\/taki-lab.site\/bocci\/?p=2108\">\u3010Laravel\u3011\u3010\u30db\u30c6\u30eb\u4e88\u7d04\u7ba1\u7406\u3011\u30e6\u30fc\u30b6\u30fc\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u4e88\u7d04\u767b\u9332<\/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;\u3010Laravel\u3011\u3010\u30db\u30c6\u30eb\u4e88\u7d04\u7ba1\u7406\u3011\u30e6\u30fc\u30b6\u30fc\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u4e88\u7d04\u767b\u9332&#8221; &#8212; \u81ea\u5206\u3001\u307c\u3063\u3061\u3067\u3059\u304c\u4f55\u304b\uff1f\" src=\"https:\/\/taki-lab.site\/bocci\/?p=2108&#038;embed=true#?secret=UVP80B5gAO#?secret=6mOjjoKfjH\" data-secret=\"6mOjjoKfjH\" width=\"474\" height=\"267\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>\u6700\u65b0\u30bd\u30fc\u30b9\u306f\u3053\u3061\u3089(gitHub)<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/takishita2nd\/hotel-mng\">https:\/\/github.com\/takishita2nd\/hotel-mng<\/a><\/p>\n\n\n\n<p>\u3055\u3066\u3001\u524d\u56de\u306f\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u3067\u306e\u3042\u308c\u3053\u308c\u3092\u4fee\u6b63\u3057\u305f\u306e\u3067\u3059\u304c\u3001\u305d\u308c\u306b\u4f34\u3063\u3066\u3001\u7ba1\u7406\u8005\u30ed\u30b0\u30a4\u30f3\u3067\u306e\u3042\u308c\u3082\u308c\u3082\u76f4\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u305a\u306f\u3001\u4e88\u7d04\u4e00\u89a7\u753b\u9762\u3002<\/p>\n\n\n\n<p>\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u3067\u306f\u3001\u30ed\u30b0\u30a4\u30f3\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u306e\u3082\u306e\u306e\u307f\u3092\u8868\u793a\u3055\u305b\u307e\u3057\u305f\u304c\u3001\u7ba1\u7406\u8005\u30ed\u30b0\u30a4\u30f3\u3067\u306f\u3001\u5168\u30e6\u30fc\u30b6\u30fc\u306e\u60c5\u5831\u3092\u8868\u793a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u306a\u306e\u3067\u3001\u30ed\u30fc\u30eb\u300c\u7ba1\u7406\u8005(manager)\u300d\u3067\u306a\u3051\u308c\u3070where\u53e5\u3067\u30e6\u30fc\u30b6\u30fc\u3092\u6307\u5b9a\u3059\u308b\u3068\u3044\u3046\u3075\u3046\u306b\u5909\u3048\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    public function getListByMonth($year, $month, $room, $userId)\n    {\n        $select = &#91;'reserve_managements.id as id', 'users.name as name', 'users.address as address', 'users.phone as phone', 'num', 'rooms.id as roomid', 'rooms.name as room', 'days', 'checkout', 'start_day'];\n        $query = ReserveManagement::select($select)\n                                ->leftJoin('reserve_management_room', 'reserve_managements.id', '=', 'reserve_management_room.reserve_management_id')\n                                ->leftJoin('rooms', 'reserve_management_room.room_id', '=', 'rooms.id')\n                                ->leftJoin('reserve_management_user', 'reserve_managements.id', '=', 'reserve_management_user.reserve_management_id')\n                                ->leftJoin('users', 'reserve_management_user.user_id', '=', 'users.id')\n                                ->where('start_day', '>=', date('Y-m-d', strtotime('first day of '.$year.'-'.$month)))\n                                ->where('start_day', '&lt;=', date('Y-m-d', strtotime('last day of '.$year.'-'.$month)))\n                                ->where('reserve_management_room.room_id', $room)\n                                ->where('lodging', false);\n        if(Gate::denies('manager')){\n            $query = $query->where('users.id', $userId);\n        }\n        $query = $query->orderBy('start_day');\n        return $query->get();\n    }\n<\/code><\/pre>\n\n\n\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u3001where()\u3092\u3001Gate::denies()\u3067\u300c\u7ba1\u7406\u8005\u4ee5\u5916\u300d\u3068\u3059\u308c\u3070\u3001\u3053\u306ewhere\u306f\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u306e\u307f\u306b\u9069\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"474\" height=\"253\" data-attachment-id=\"2150\" data-permalink=\"https:\/\/taki-lab.site\/bocci\/?attachment_id=2150\" data-orig-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-11-56-01.png?fit=778%2C415&amp;ssl=1\" data-orig-size=\"778,415\" 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=\"Screenshot-from-2020-01-15-11-56-01\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-11-56-01.png?fit=474%2C253&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-11-56-01.png?resize=474%2C253\" alt=\"\" class=\"wp-image-2150\" srcset=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-11-56-01.png?w=778&amp;ssl=1 778w, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-11-56-01.png?resize=300%2C160&amp;ssl=1 300w, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-11-56-01.png?resize=768%2C410&amp;ssl=1 768w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/figure>\n\n\n\n<p>\u6b21\u306f\u3001\u4e88\u7d04\u8ffd\u52a0\u753b\u9762\u3002<\/p>\n\n\n\n<p>\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u306e\u5834\u5408\u306f\u3001\u30ed\u30b0\u30a4\u30f3\u4e2d\u306e\u540d\u524d\u306a\u3069\u306e\u8868\u793a\u3055\u305b\u307e\u3057\u305f\u304c\u3001\u7ba1\u7406\u8005\u30ed\u30b0\u30a4\u30f3\u306e\u5834\u5408\u306f\u3001\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u30e6\u30fc\u30b6\u30fc\u3092\u9078\u629e\u3057\u3066\u767b\u9332\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u3053\u3053\u3067Vue.js\u306e\u51fa\u756a\u3067\u3059\u3002\uff08\u307e\u3058\u304b\u30fb\u30fb\u30fb\uff09<\/p>\n\n\n\n<p>\u307e\u305a\u306f\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3002<\/p>\n\n\n\n<p>\u57fa\u672c\u7684\u306b\u306f\u3001\u7de8\u96c6\u6642\u306eVue.js\u3092\u53c2\u8003\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;template>\n    &lt;div>\n        &lt;p v-if=\"error_flg == true\" class=\"error\">{{error_message}}&lt;\/p>\n        &lt;table class=\"edit\">\n            &lt;tbody>\n                &lt;tr>\n                    &lt;th>\u540d\u524d&lt;\/th>\n                    &lt;td v-if=role>{{ contents.name }}&lt;button @click=\"openModal\">\u691c\u7d22&lt;\/button>&lt;\/td>\n                    &lt;td v-else>{{ contents.name }}&lt;\/td>\n                &lt;\/tr>\n                &lt;tr>\n                    &lt;th>\u4f4f\u6240&lt;\/th>\n                    &lt;td>{{ contents.address }}&lt;\/td>\n                &lt;\/tr>\n                &lt;tr>\n                    &lt;th>\u96fb\u8a71\u756a\u53f7&lt;\/th>\n                    &lt;td>{{ contents.phone }}&lt;\/td>\n                &lt;\/tr>\n                &lt;tr>\n                    &lt;th>\u4eba\u6570&lt;\/th>\n                    &lt;td>\n                        &lt;select v-model=contents.num>\n                            &lt;option v-for=\"num in nums\" v-bind:value=\"num.value\">{{ num.text }}&lt;\/option>\n                        &lt;\/select>\n                    &lt;\/td>\n                &lt;\/tr>\n                &lt;tr>\n                    &lt;th>\u5bbf\u6cca\u90e8\u5c4b&lt;\/th>\n                    &lt;td>\n                        &lt;select v-model=\"contents.roomid\">\n                            &lt;option v-for=\"room in rooms\" v-bind:value=\"room.id\">{{ room.name }}&lt;\/option>\n                        &lt;\/select>\n                    &lt;\/td>\n                &lt;\/tr>\n                &lt;tr>\n                    &lt;th>\u5bbf\u6cca\u65e5\u6570&lt;\/th>\n                    &lt;td>&lt;input type=\"number\" v-model=contents.days \/>&lt;\/td>\n                &lt;\/tr>\n                &lt;tr>\n                    &lt;th>\u5bbf\u6cca\u65e5&lt;\/th>\n                    &lt;td>&lt;input type=\"date\" v-model=contents.start_day \/>&lt;\/td>\n                &lt;\/tr>\n                &lt;tr>\n                    &lt;th>\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8&lt;\/th>\n                    &lt;td>\n                        &lt;select v-model=\"contents.checkout\">\n                            &lt;option v-for=\"time in timeList\" v-bind:value=\"time.key\">{{ time.value }}&lt;\/option>\n                        &lt;\/select>\n                    &lt;\/td>\n                &lt;\/tr>\n            &lt;\/tbody>\n        &lt;\/table>\n        &lt;p>&lt;button @click=\"regist\">\u767b\u9332&lt;\/button>&lt;\/p>\n        &lt;div id=\"overlay\" v-show=\"showContent\">\n            &lt;div id=\"content\">\n                &lt;table class=\"edit\">\n                    &lt;p>\u540d\u524d&lt;input type=\"text\" v-model=param.search \/>&lt;\/p>\n                    &lt;tbody>\n                        &lt;tr>\n                            &lt;th>\u540d\u524d&lt;\/th>\n                            &lt;th>\u4f4f\u6240&lt;\/th>\n                            &lt;th>\u96fb\u8a71\u756a\u53f7&lt;\/th>\n                        &lt;\/tr>\n                        &lt;tr v-for=\"user in users\" @click=\"selectUser(user)\">\n                            &lt;td class=\"name\">{{ user.name }}&lt;\/td>\n                            &lt;td class=\"address\">{{ user.address }}&lt;\/td>\n                            &lt;td class=\"phone\">{{ user.phone }}&lt;\/td>\n                        &lt;\/tr>\n                    &lt;\/tbody>\n                &lt;\/table>\n            &lt;p>\n                &lt;button @click=\"closeModal\">close&lt;\/button>\n                &lt;button @click=\"searchUsers\">\u691c\u7d22&lt;\/button>\n            &lt;\/p>\n            &lt;\/div>\n        &lt;\/div>\n    &lt;\/div>\n&lt;\/template>\n<\/code><\/pre>\n\n\n\n<p>\u307e\u305a\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u90e8\u5206\u3067\u3059\u304c\u3001\u540d\u524d\u3001\u4f4f\u6240\u3001\u96fb\u8a71\u756a\u53f7\u4ee5\u5916\u306f\u3001\u7de8\u96c6\u753b\u9762\u3092\u305d\u306e\u307e\u307e\u4f7f\u7528\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u554f\u984c\u306e\u3001\u540d\u524d\u3001\u4f4f\u6240\u3001\u96fb\u8a71\u756a\u53f7\u306e\u90e8\u5206\u3067\u3059\u304c\u3001\u7ba1\u7406\u8005\u30ed\u30b0\u30a4\u30f3\u306a\u3089\u3070\u3001\u691c\u7d22\u30dc\u30bf\u30f3\u3092\u8a2d\u7f6e\u3057\u3001\u305d\u308c\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u30e2\u30fc\u30c0\u30eb\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u8868\u793a\u3059\u308b\u3001\u3068\u3044\u3046\u4ed5\u7d44\u307f\u306b\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30e2\u30fc\u30c0\u30eb\u30c0\u30a4\u30a2\u30ed\u30b0\u3067\u30e6\u30fc\u30b6\u30fc\u3092\u691c\u7d22\u3057\u3001\u305d\u306e\u540d\u524d\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u767b\u9332\u753b\u9762\u306b\u53cd\u6620\u3055\u308c\u308b\u3001\u3068\u3044\u3046\u52d5\u304d\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5b9f\u969b\u306e\u51e6\u7406\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;script>\n    export default {\n        data() {\n            return {\n                role: false,\n                error_message: \"\",\n                error_flg:false,\n                errors: {},\n                nums: &#91;\n                    {text:'1', value:1},\n                    {text:'2', value:2}\n                ],\n                timeList:&#91;],\n                rooms: &#91;],\n                users: &#91;],\n                showContent: false,\n                param: {\n                    search: \"\",\n                },\n                contents: {\n                    id: 0,\n                    name: \"\",\n                    address: \"\",\n                    phone: \"\",\n                    num: 0,\n                    roomid: 0,\n                    room: \"\",\n                    days: 0,\n                    start_day: \"\",\n                    checkout: \"\",\n                },\n            }\n        },\n        created: function() {\n            this.getRole();\n            this.getRooms();\n            this.getTimeList();\n        },\n        methods: {\n            getRole: function() {\n                var self = this;\n                axios.post('\/api\/role').then(function(response){\n                    self.role = response.data.role;\n                    if(self.role == false){\n                        self.contents.id = response.data.user.id;\n                        self.contents.name = response.data.user.name;\n                        self.contents.address = response.data.user.address;\n                        self.contents.phone = response.data.user.phone;\n                    }\n                }).catch(function(error){\n                    console.log(\"\u5931\u6557\u3057\u307e\u3057\u305f\");\n                });\n            },\n            searchUsers: function() {\n                this.users = &#91;];\n                var self = this;\n                axios.post('\/api\/users', this.param).then(function(response){\n                    response.data.users.forEach(element => {\n                        self.users.push({id:element.id, name:element.name, address:element.address, phone:element.phone});\n                    });\n                }).catch(function(error){\n                    console.log(\"\u5931\u6557\u3057\u307e\u3057\u305f\");\n                });\n            },\n            selectUser: function(user) {\n                this.contents.id = user.id;\n                this.contents.name = user.name;\n                this.contents.address = user.address;\n                this.contents.phone = user.phone;\n                this.closeModal();\n            },\n            regist: function() {\n                var self = this;\n                this.param.contents = this.contents;\n                axios.post('\/api\/add', this.param).then(function(response){\n                    document.location = \"\/management\";\n                }).catch(function(error){\n                    self.error_flg = true;\n                    self.error_message = error.response.data.errors;\n                    console.log(\"\u5931\u6557\u3057\u307e\u3057\u305f\");\n                });\n            },\n            getRooms: function() {\n                var self = this;\n                axios.post('\/api\/rooms').then(function(response){\n                    response.data.roomLists.forEach(element => {\n                        self.rooms.push({id:element.id, name:element.name});\n                    });\n                }).catch(function(error){\n                    console.log(\"\u5931\u6557\u3057\u307e\u3057\u305f\");\n                });\n            },\n            getTimeList: function(){\n                var self = this;\n                axios.post('\/api\/timelist').then(function(response){\n                    for (let &#91;key, value] of Object.entries(response.data.timelist)){\n                        self.timeList.push({key: key, value: value});\n                    }\n                }).catch(function(error){\n                    console.log(\"\u5931\u6557\u3057\u307e\u3057\u305f\");\n                });\n            },\n            openModal: function(){\n                this.users = &#91;];\n                this.showContent = true;\n            },\n            closeModal: function(){\n                this.showContent = false;\n                this.edit_flg = false;\n            },\n        }\n    }\n&lt;\/script>\n<\/code><\/pre>\n\n\n\n<p>\u30dd\u30a4\u30f3\u30c8\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u3082\u7ba1\u7406\u8005\u30ed\u30b0\u30a4\u30f3\u3082\u4f7f\u7528\u3059\u308b\u3068\u3044\u3046\u3053\u3068\u3002<\/p>\n\n\n\n<p>\u306a\u306e\u3067\u3001\u73fe\u5728\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u3044\u308b\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u30ed\u30fc\u30eb\u3092getRole()\u3067\u6700\u521d\u306b\u53d6\u5f97\u3057\u3066\u3044\u308b\u3001\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306egetRole()\u306e\u7d50\u679c\u3067\u8868\u793a\u5185\u5bb9\u3092\u5207\u308a\u66ff\u3048\u305f\u308a\u3057\u3066\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u3057\u3066\u3001\u5fc5\u8981\u4e8b\u9805\u3092\u5165\u529b\u3057\u305f\u3089\u3001\u767b\u9332\u51e6\u7406\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u3068\u304d\u5fc5\u8981\u306b\u306a\u308b\u306e\u306f\u3001\u30e6\u30fc\u30b6\u30fcID\u3002\u3053\u308c\u3082\u9001\u4fe1\u3059\u308b\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u542b\u3081\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3067\u306f\u3001API\u5074\u306e\u51e6\u7406\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    public function __construct()\n    {\n        $this->middleware('auth');\n        $this->registerManagement = new RegisterManagementRepository();\n        $this->room = new RoomRepository();\n        $this->user = new UserRepository();\n    }\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>    public function role(Request $request)\n    {\n        return response()->json(&#91;'role' => Gate::Allows('manager'),\n                                 'user' => Auth::user()]);\n    }\n\n    public function users(Request $request)\n    {\n        return response()->json(&#91;'users' => $this->user->search($request->search)]);\n    }\n\n    public function add(Request $request)\n    {\n        \\Log::debug(print_r($request->contents, true));\n        if($this->registerManagement->checkSchedule($request->contents&#91;\"start_day\"], \n                                                    $request->contents&#91;\"days\"], \n                                                    $request->contents&#91;\"roomid\"]) == false)\n        {\n            return response()->json(&#91;\n                'errors' => \"\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u304c\u91cd\u8907\u3057\u3066\u3044\u307e\u3059\"\n            ], 400);\n        }\n        $param = $this->registerManagement->getParam();\n        $this->registerManagement->add(&#91;\n            $param&#91;0] => $request->contents&#91;\"num\"],\n            $param&#91;1] => $request->contents&#91;\"days\"],\n            $param&#91;2] => $request->contents&#91;\"start_day\"],\n            $param&#91;3] => false,\n            $param&#91;4] => date('Y-m-d H:i', strtotime($request->contents&#91;\"start_day\"].' + '.$request->contents&#91;\"days\"].' day') + $request->contents&#91;\"checkout\"])\n        ], $request->contents&#91;\"roomid\"], $this->user->getUserById($request->contents&#91;\"id\"]));\n        return response()->json();\n    }\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>class UserRepository\n{\n    public function __construct()\n    {\n\n    }\n\n    public function getUserById($id)\n    {\n        return User::where(\"id\", $id)->first();\n    }\n\n    public function search($word)\n    {\n        $select = &#91;'id', 'name', 'address', 'phone'];\n        return User::select($select)\n                    ->where('name', 'like', \"%{$word}%\")\n                    ->get();\n    }\n}<\/code><\/pre>\n\n\n\n<p>\u30e6\u30fc\u30b6\u30fc\u691c\u7d22\u3067\u4f7f\u7528\u3059\u308b\u300c\u3042\u3044\u307e\u3044\u691c\u7d22\u300d\u306f\u3053\u3093\u306a\u611f\u3058\u3067\u300clike\u300d\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u7ba1\u7406\u8005\u30ed\u30b0\u30a4\u30f3\u6642\u306e\u52d5\u4f5c<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"474\" height=\"214\" data-attachment-id=\"2151\" data-permalink=\"https:\/\/taki-lab.site\/bocci\/?attachment_id=2151\" data-orig-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-10-18-15.png?fit=775%2C350&amp;ssl=1\" data-orig-size=\"775,350\" 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=\"Screenshot-from-2020-01-15-10-18-15\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-10-18-15.png?fit=474%2C214&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-10-18-15.png?resize=474%2C214\" alt=\"\" class=\"wp-image-2151\" srcset=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-10-18-15.png?w=775&amp;ssl=1 775w, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-10-18-15.png?resize=300%2C135&amp;ssl=1 300w, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-10-18-15.png?resize=768%2C347&amp;ssl=1 768w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"474\" height=\"198\" data-attachment-id=\"2152\" data-permalink=\"https:\/\/taki-lab.site\/bocci\/?attachment_id=2152\" data-orig-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-10-18-30.png?fit=563%2C235&amp;ssl=1\" data-orig-size=\"563,235\" 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=\"Screenshot-from-2020-01-15-10-18-30\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-10-18-30.png?fit=474%2C198&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-10-18-30.png?resize=474%2C198\" alt=\"\" class=\"wp-image-2152\" srcset=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-10-18-30.png?w=563&amp;ssl=1 563w, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-10-18-30.png?resize=300%2C125&amp;ssl=1 300w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/figure>\n\n\n\n<p>\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u6642\u306e\u52d5\u4f5c<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"474\" height=\"227\" data-attachment-id=\"2153\" data-permalink=\"https:\/\/taki-lab.site\/bocci\/?attachment_id=2153\" data-orig-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-11-33-19.png?fit=771%2C369&amp;ssl=1\" data-orig-size=\"771,369\" 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=\"Screenshot-from-2020-01-15-11-33-19\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-11-33-19.png?fit=474%2C227&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-11-33-19.png?resize=474%2C227\" alt=\"\" class=\"wp-image-2153\" srcset=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-11-33-19.png?w=771&amp;ssl=1 771w, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-11-33-19.png?resize=300%2C144&amp;ssl=1 300w, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-15-11-33-19.png?resize=768%2C368&amp;ssl=1 768w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/figure>\n\n\n\n<p>\u3053\u308c\u3067\u3046\u307e\u304f\u884c\u3063\u305f\u307f\u305f\u3044\u3067\u3059\u3002\uff08\u75b2\u308c\u305f\u3002\u3002\u3002\uff09<\/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","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u307e\u3067\u306e\u72b6\u6cc1\u306f\u3053\u3061\u3089 \u6700\u65b0\u30bd\u30fc\u30b9\u306f\u3053\u3061\u3089(gitHub) https:\/\/github.com\/takishita2nd\/hotel-mng \u3055\u3066\u3001\u524d\u56de\u306f\u30e6\u30fc\u30b6\u30fc\u30ed\u30b0\u30a4\u30f3\u3067\u306e\u3042\u308c\u3053\u308c\u3092\u4fee\u6b63\u3057\u305f\u306e\u3067\u3059\u304c\u3001\u305d\u308c\u306b\u4f34\u3063\u3066\u3001\u7ba1 &hellip; <a href=\"https:\/\/taki-lab.site\/bocci\/?p=2145\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u3010Laravel\u3011\u3010\u30db\u30c6\u30eb\u4e88\u7d04\u7ba1\u7406\u3011\u7ba1\u7406\u8005\u753b\u9762\u306e\u4fee\u6b63<\/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":"\u3010Laravel\u3011\u3010\u30db\u30c6\u30eb\u4e88\u7d04\u7ba1\u7406\u3011\u7ba1\u7406\u8005\u753b\u9762\u306e\u4fee\u6b63\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,8,3],"tags":[138,79],"class_list":["post-2145","post","type-post","status-publish","format-standard","hentry","category-laravel","category-linux","category-3","tag-laravel","tag-linux"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8SDbY-yB","jetpack-related-posts":[{"id":2119,"url":"https:\/\/taki-lab.site\/bocci\/?p=2119","url_meta":{"origin":2145,"position":0},"title":"\u3010Laravel\u3011\u3010\u30db\u30c6\u30eb\u4e88\u7d04\u7ba1\u7406\u3011\u4e88\u7d04\u60c5\u5831\u3092\u5909\u66f4\u3001\u524a\u9664\u3059\u308b","author":"taki","date":"2020\u5e741\u670813\u65e5","format":false,"excerpt":"\u524d\u56de\u307e\u3067\u306e\u72b6\u6cc1\u306f\u3053\u3061\u3089 https:\/\/taki-lab.site\/bocci\/?p=2108 \u6700\u65b0\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\/01\/Screenshot-from-2020-01-13-08-52-52.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-13-08-52-52.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-13-08-52-52.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":2099,"url":"https:\/\/taki-lab.site\/bocci\/?p=2099","url_meta":{"origin":2145,"position":1},"title":"\u3010Laravel\u3011\u3010\u30db\u30c6\u30eb\u4e88\u7d04\u7ba1\u7406\u3011\u30e6\u30fc\u30b6\u30fc\u306e\u6a29\u9650\u7ba1\u7406\u3092\u884c\u3046","author":"taki","date":"2020\u5e741\u67088\u65e5","format":false,"excerpt":"\u6700\u65b0\u30bd\u30fc\u30b9\u306f\u3053\u3061\u3089(gitHub) https:\/\/github.com\/takishita2nd\/\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\/01\/Screenshot-from-2020-01-08-09-06-37.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-08-09-06-37.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-08-09-06-37.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-08-09-06-37.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1656,"url":"https:\/\/taki-lab.site\/bocci\/?p=1656","url_meta":{"origin":2145,"position":2},"title":"\u3010Linux\u3011\u3010Laravel\u3011Auth\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u3002","author":"taki","date":"2019\u5e7411\u670816\u65e5","format":false,"excerpt":"Laravel\u306bAuth\u6a5f\u80fd\uff08\u8981\u306f\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\uff09\u3092\u5b9f\u88c5\u3057\u307e\u3059\u3002 Laravel\u3063\u3066\u4fbf\u5229\u306a\u3082\u306e\u3067\u3001\u30c7\u30d5\u2026","rel":"","context":"Linux","block_context":{"text":"Linux","link":"https:\/\/taki-lab.site\/bocci\/?cat=8"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/11\/Screenshot-from-2019-11-16-09-18-59.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/11\/Screenshot-from-2019-11-16-09-18-59.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/11\/Screenshot-from-2019-11-16-09-18-59.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/11\/Screenshot-from-2019-11-16-09-18-59.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":819,"url":"https:\/\/taki-lab.site\/bocci\/?p=819","url_meta":{"origin":2145,"position":3},"title":"VPS\u3067\u30b5\u30fc\u30d0\u3092\u7acb\u3061\u4e0a\u3052\u308b\uff01","author":"taki","date":"2019\u5e742\u67081\u65e5","format":false,"excerpt":"VPS\u3068\u306f\u30af\u30e9\u30a6\u30c9\u4e0a\u306b\u30b5\u30fc\u30d0\u3092\u7acb\u3061\u4e0a\u3052\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u30ec\u30f3\u30bf\u30eb\u30b5\u30fc\u30d0\u3068\u9055\u3046\u306e\u306f\u3001\u30ec\u30f3\u30bf\u30eb\u30b5\u30fc\u30d0\u306f\u2026","rel":"","context":"Linux","block_context":{"text":"Linux","link":"https:\/\/taki-lab.site\/bocci\/?cat=8"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2161,"url":"https:\/\/taki-lab.site\/bocci\/?p=2161","url_meta":{"origin":2145,"position":4},"title":"\u3010Laravel\u3011\u3010\u30db\u30c6\u30eb\u4e88\u7d04\u7ba1\u7406\u3011\u5fd8\u308c\u3066\u3044\u305f\u6a5f\u80fd\u3092\u8ffd\u52a0\u3059\u308b","author":"taki","date":"2020\u5e741\u670817\u65e5","format":false,"excerpt":"\u524d\u56de\u307e\u3067\u306e\u72b6\u6cc1\u306f\u3053\u3061\u3089\u3002 https:\/\/taki-lab.site\/bocci\/?p=2145 \u6700\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\/01\/Screenshot-from-2020-01-17-08-26-16.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-17-08-26-16.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/01\/Screenshot-from-2020-01-17-08-26-16.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":4218,"url":"https:\/\/taki-lab.site\/bocci\/?p=4218","url_meta":{"origin":2145,"position":5},"title":"\u3010\u30c0\u30a4\u30a8\u30c3\u30c8\u652f\u63f4\u3011\u3082\u3063\u3068\u5177\u4f53\u7684\u306a\u8a2d\u8a08\u3092\u3057\u306a\u304f\u3061\u3083\u3044\u3051\u306a\u304f\u3066","author":"taki","date":"2020\u5e749\u670830\u65e5","format":false,"excerpt":"https:\/\/taki-lab.site\/bocci\/?p=4180 \u305f\u3076\u3093\u3001\u524d\u56de\u306e\u8a18\u4e8b\u306e\u5185\u5bb9\u3060\u3051\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":[]}],"jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts\/2145","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=2145"}],"version-history":[{"count":1,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts\/2145\/revisions"}],"predecessor-version":[{"id":2154,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts\/2145\/revisions\/2154"}],"wp:attachment":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}