{"id":1891,"date":"2019-12-11T08:31:47","date_gmt":"2019-12-10T23:31:47","guid":{"rendered":"http:\/\/taki-lab.site\/bocci\/?p=1891"},"modified":"2019-12-11T08:40:03","modified_gmt":"2019-12-10T23:40:03","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%e4%ba%88%e7%b4%84%e4%b8%80%e8%a6%a7%e3%81%ab%e9%83%a8%e5%b1%8b%e3%82%92%e9%80%a3%e6%90%ba","status":"publish","type":"post","link":"https:\/\/taki-lab.site\/bocci\/?p=1891","title":{"rendered":"\u3010Laravel\u3011\u3010\u30db\u30c6\u30eb\u4e88\u7d04\u7ba1\u7406\u3011\u4e88\u7d04\u4e00\u89a7\u306b\u90e8\u5c4b\u3092\u9023\u643a\u3055\u305b\u308b"},"content":{"rendered":"\n<p>\u524d\u56de\u307e\u3067\u306e\u69d8\u5b50\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=\"LhxKA1xptB\"><a href=\"https:\/\/taki-lab.site\/bocci\/?p=1876\">\u3010Laravel\u3011\u3010\u30db\u30c6\u30eb\u4e88\u7d04\u7ba1\u7406\u3011\u90e8\u5c4b\u3092\u5897\u8a2d\u3059\u308b<\/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\u90e8\u5c4b\u3092\u5897\u8a2d\u3059\u308b&#8221; &#8212; \u81ea\u5206\u3001\u307c\u3063\u3061\u3067\u3059\u304c\u4f55\u304b\uff1f\" src=\"https:\/\/taki-lab.site\/bocci\/?p=1876&#038;embed=true#?secret=TL8leWjE8D#?secret=LhxKA1xptB\" data-secret=\"LhxKA1xptB\" 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<\/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>\u524d\u56de\u306f\u90e8\u5c4b\u3092\u767b\u9332\u30fb\u7de8\u96c6\u30fb\u524a\u9664\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u306e\u3067\u3001\u3053\u308c\u3092\u4e88\u7d04\u7ba1\u7406\u3068\u9023\u643a\u3055\u305b\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u305a\u306f\u4e00\u89a7\u8868\u793a\u3002<\/p>\n\n\n\n<p>\u30ea\u30dd\u30b8\u30c8\u30ea\u306eget\u51e6\u7406\u3092\u4fee\u6b63\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    \/**\n     * \u4e88\u7d04\u4e00\u89a7\u3092\u53d6\u5f97\u3059\u308b\n     * \n     * @return ReserveManagement&#91;]\n     *\/\n    public function getList()\n    {\n        $select = &#91;'reserve_managements.id as id', 'reserve_managements.name as name', 'address', 'phone', 'num', 'rooms.name as room', 'days', 'start_day'];\n        return ReserveManagement::select($select)\n                                    ->where('lodging', false)\n                                    ->orderBy('start_day')\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                                    ->get();\n    }\n<\/code><\/pre>\n\n\n\n<p>\u7d50\u5408\u3092\u4f7f\u3063\u3066\u4e00\u89a7\u753b\u9762\u306b\u90e8\u5c4b\u540d\u3082\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u304a\u305d\u3089\u304f\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u3046\u3088\u308a\u306f\u3053\u3061\u3089\u306e\u307b\u3046\u304c\u65e9\u3044\u3088\u3046\u306a\u6c17\u304c\u3057\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=\"234\" data-attachment-id=\"1892\" data-permalink=\"https:\/\/taki-lab.site\/bocci\/?attachment_id=1892\" data-orig-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-11-08-08-07.png?fit=806%2C398&amp;ssl=1\" data-orig-size=\"806,398\" 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-2019-12-11-08-08-07\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-11-08-08-07.png?fit=474%2C234&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-11-08-08-07.png?resize=474%2C234\" alt=\"\" class=\"wp-image-1892\" srcset=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-11-08-08-07.png?w=806&amp;ssl=1 806w, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-11-08-08-07.png?resize=300%2C148&amp;ssl=1 300w, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-11-08-08-07.png?resize=768%2C379&amp;ssl=1 768w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/figure>\n\n\n\n<p>\u6b21\u306f\u4e88\u7d04\u767b\u9332\u51e6\u7406\u3002<\/p>\n\n\n\n<p>\u767b\u9332\u753b\u9762\u306b\u306f\u3001\u90e8\u5c4b\u30c6\u30fc\u30d6\u30eb\u306e\u4e2d\u8eab\u3092\u30b3\u30f3\u30dc\u30dc\u30c3\u30af\u30b9\u3067\u9078\u629e\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>                    &lt;tr>\n                        &lt;th>\u5bbf\u6cca\u90e8\u5c4b&lt;\/th>\n                        &lt;td>{!! Form::select('room', $rooms) !!}&lt;\/td>\n                    &lt;\/tr>\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>    \/**\n     * \u5165\u529b\u30d5\u30a9\u30fc\u30e0\n     *\n     * @return \\Illuminate\\Http\\Response\n     *\/\n    public function create()\n    {\n        return view('register.create',\n                    &#91;'rooms' => $this->roomRepository->getRoomList()]);\n    }\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>    \/**\n     * ID\u3068\u90e8\u5c4b\u540d\u306e\u30ea\u30b9\u30c8\u3092\u53d6\u5f97\u3059\u308b\n     *\/\n    public function getRoomList()\n    {\n        $rooms = Array();\n        foreach(Room::get() as $room)\n        {\n            $rooms&#91;$room->id] = $room->name;\n        }\n        return $rooms;\n    }\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"474\" height=\"330\" data-attachment-id=\"1893\" data-permalink=\"https:\/\/taki-lab.site\/bocci\/?attachment_id=1893\" data-orig-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-11-08-08-21.png?fit=525%2C366&amp;ssl=1\" data-orig-size=\"525,366\" 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-2019-12-11-08-08-21\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-11-08-08-21.png?fit=474%2C330&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-11-08-08-21.png?resize=474%2C330\" alt=\"\" class=\"wp-image-1893\" srcset=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-11-08-08-21.png?w=525&amp;ssl=1 525w, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-11-08-08-21.png?resize=300%2C209&amp;ssl=1 300w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/figure>\n\n\n\n<p>\u5b9f\u969b\u306b\u767b\u9332\u3092\u884c\u3046\u969b\u306f\u3001POST\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u90e8\u5c4bID\u3092\u53d7\u3051\u53d6\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4e88\u7d04\u30ec\u30b3\u30fc\u30c9\u3068\u90e8\u5c4b\u30ec\u30b3\u30fc\u30c9\u3092\u4e2d\u9593\u30c6\u30fc\u30d6\u30eb\u3067\u9023\u643a\u3055\u305b\u308b\u3053\u3068\u3067\u4e88\u7d04\u3068\u90e8\u5c4b\u3092\u7d10\u3065\u3051\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    \/**\n     * \u767b\u9332\u51e6\u7406\n     *\/\n    public function store(ManagementRequest $request)\n    {\n        if($this->registerManagement->checkSchedule($request->start_day, $request->days) == false)\n        {\n            return redirect('management\/create')\n                        ->with(&#91;'error' => '\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u304c\u91cd\u8907\u3057\u307e\u3059'])\n                        ->withInput();\n        }\n        $param = $this->registerManagement->getParam();\n        $this->registerManagement->add(&#91;\n            $param&#91;0] => $request->name,\n            $param&#91;1] => $request->address,\n            $param&#91;2] => $request->phone,\n            $param&#91;3] => $request->num,\n            $param&#91;4] => $request->days,\n            $param&#91;5] => $request->start_day,\n            $param&#91;6] => false\n        ], $request->room);\n        return redirect('management');\n    }\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>    \/**\n     * \u4e88\u7d04\u3092\u767b\u9332\u3059\u308b\n     * \n     * @return void\n     *\/\n    public function add($param, $room)\n    {\n        $model = new ReserveManagement;\n        foreach($this->paramNames as $name)\n        {\n            $model->$name = $param&#91;$name];\n        }\n        $model->save();\n        $this->attachToRoom($model, $room);\n        $this->attachToSchedule($model);\n    }\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>    public function attachToRoom($model, $room)\n    {\n        $model3 = Room::where('id', $room)->first();\n        $model->rooms()->attach($model3);\n    }\n<\/code><\/pre>\n\n\n\n<p>\u4e88\u7d04\u7de8\u96c6\u3082\u540c\u69d8\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>                    &lt;tr>\n                        &lt;th>\u5bbf\u6cca\u90e8\u5c4b&lt;\/th>\n                        &lt;td>{!! Form::select('room', $rooms, $item->room_num) !!}&lt;\/td>\n                    &lt;\/tr>\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>    \/**\n     * \u7de8\u96c6\u51e6\u7406\n     *\n     * @return \\Illuminate\\Http\\Response\n     *\/\n    public function edit($id)\n    {\n        return view('register.edit',\n                    &#91;'item' => $this->registerManagement->getReserveById($id),\n                     'rooms' => $this->roomRepository->getRoomList()]);\n    }\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>    \/**\n     * \u4e88\u7d04\u3092\u4e00\u4ef6\u53d6\u5f97\u3059\u308b\n     *\/\n    public function getReserveById($id)\n    {\n        $model = $this->getItemById($id);\n        $model->room_num = $model->rooms()->first()->id;\n        $model->room_name = $model->rooms()->first()->name;\n        return $model;\n    }\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"474\" height=\"362\" data-attachment-id=\"1894\" data-permalink=\"https:\/\/taki-lab.site\/bocci\/?attachment_id=1894\" data-orig-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-11-08-08-33.png?fit=482%2C368&amp;ssl=1\" data-orig-size=\"482,368\" 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-2019-12-11-08-08-33\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-11-08-08-33.png?fit=474%2C362&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-11-08-08-33.png?resize=474%2C362\" alt=\"\" class=\"wp-image-1894\" srcset=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-11-08-08-33.png?w=482&amp;ssl=1 482w, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-11-08-08-33.png?resize=300%2C229&amp;ssl=1 300w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/figure>\n\n\n\n<p>\u4e00\u4ef6\u306e\u30c7\u30fc\u30bf\u306e\u5834\u5408\u306f\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u3046\u306e\u304c\u7c21\u5358\u3067\u3059\u3002\u3053\u308c\u304c\u3067\u304d\u308bLaravel\u306f\u30db\u30f3\u30c8\u4fbf\u5229\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    \/**\n     * \u66f4\u65b0\u51e6\u7406\n     *\/\n    public function update(ManagementRequest $request)\n    {\n        if($this->registerManagement->checkScheduleForUpdate($request->start_day, $request->days, $request->id) == false)\n        {\n            return redirect('management\/create')\n                        ->with(&#91;'error' => '\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u304c\u91cd\u8907\u3057\u307e\u3059'])\n                        ->withInput();\n        }\n        $param = $this->registerManagement->getParam();\n        $this->registerManagement->updateById($request->id,\n        &#91;\n            $param&#91;0] => $request->name,\n            $param&#91;1] => $request->address,\n            $param&#91;2] => $request->phone,\n            $param&#91;3] => $request->num,\n            $param&#91;4] => $request->days,\n            $param&#91;5] => $request->start_day,\n            $param&#91;6] => false\n        ], $request->room);\n        return redirect('management');\n    }\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>    \/**\n     * \u4e88\u7d04\u3092\u66f4\u65b0\u3059\u308b\n     * \n     * @return void\n     *\/\n    public function updateById($id, $param, $room)\n    {\n        $model = $this->getItemById($id);\n        foreach($this->paramNames as $name)\n        {\n            $model->$name = $param&#91;$name];\n        }\n        $model->save();\n        $this->detachToRoom($model, $model->rooms()->first()->id);\n        $this->detachToSchedule($model);\n        $this->attachToRoom($model, $room);\n        $this->attachToSchedule($model);\n    }\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>    public function detachToRoom($model, $room)\n    {\n        $model3 = Room::where('id', $room)->first();\n        $model->rooms()->detach($model3);\n    }\n<\/code><\/pre>\n\n\n\n<p>\u4e00\u65e6\u53e4\u3044\u60c5\u5831\u3067\u30c7\u30bf\u30c3\u30c1\u3057\u3001\u65b0\u3057\u3044\u60c5\u5831\u3067\u30a2\u30bf\u30c3\u30c1\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u524a\u9664\u3082\u540c\u3058\u3088\u3046\u306b\u3001<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>                    &lt;tr>\n                        &lt;th>\u5bbf\u6cca\u90e8\u5c4b&lt;\/th>\n                        &lt;td>{!! $item->room_name !!}&lt;\/td>\n                    &lt;\/tr>\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>    \/**\n     * \u524a\u9664\u78ba\u8a8d\n     *\n     * @return \\Illuminate\\Http\\Response\n     *\/\n    public function conform($id)\n    {\n        return view('register.conform', &#91;'item' => $this->registerManagement->getReserveById($id)]);\n    }\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"459\" height=\"363\" data-attachment-id=\"1895\" data-permalink=\"https:\/\/taki-lab.site\/bocci\/?attachment_id=1895\" data-orig-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-11-08-08-48.png?fit=459%2C363&amp;ssl=1\" data-orig-size=\"459,363\" 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-2019-12-11-08-08-48\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-11-08-08-48.png?fit=459%2C363&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-11-08-08-48.png?resize=459%2C363\" alt=\"\" class=\"wp-image-1895\" srcset=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-11-08-08-48.png?w=459&amp;ssl=1 459w, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-11-08-08-48.png?resize=300%2C237&amp;ssl=1 300w\" sizes=\"auto, (max-width: 459px) 100vw, 459px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>    \/**\n     * \u4e88\u7d04\u3092\u524a\u9664\u3059\u308b\n     * \n     * @return void\n     *\/\n    public function deleteById($id)\n    {\n        $model = $this->getItemById($id);\n        $this->detachToRoom($model, $model->rooms()->first()->id);\n        $this->detachToSchedule($model);\n        $model->delete();\n    }\n<\/code><\/pre>\n\n\n\n<p>\u305d\u3093\u306a\u306b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f\u5909\u66f4\u3057\u3066\u3044\u306a\u3044\u3051\u3069\u3001\u4e00\u6c17\u306b\u9032\u307f\u307e\u3057\u305f\u306d\u3002<\/p>\n\n\n\n<p>\u6b21\u56de\u306f\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u3092\u90e8\u5c4b\u3054\u3068\u306b\u8868\u793a\u3059\u308b\u3068\u3053\u308d\u3092\u3084\u3063\u3066\u3044\u304d\u307e\u3059\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\/blog.with2.net\/img\/banner\/c\/banner_1\/br_c_1010_1.gif?w=474&#038;ssl=1\" title=\"\u30d1\u30bd\u30b3\u30f3\u30e9\u30f3\u30ad\u30f3\u30b0\"><\/a>\n\n\n\n<p>\u30d0\u30ca\u30fc\u30af\u30ea\u30c3\u30af\u3067\u5fdc\u63f4\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u307e\u3067\u306e\u69d8\u5b50\u306f\u3053\u3061\u3089 \u6700\u65b0\u30bd\u30fc\u30b9\u306f\u3053\u3061\u3089 https:\/\/github.com\/takishita2nd\/hotel-mng \u524d\u56de\u306f\u90e8\u5c4b\u3092\u767b\u9332\u30fb\u7de8\u96c6\u30fb\u524a\u9664\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u306e\u3067\u3001\u3053\u308c\u3092\u4e88\u7d04\u7ba1\u7406\u3068\u9023\u643a\u3055\u305b\u307e\u3059\u3002 \u307e\u305a\u306f &hellip; <a href=\"https:\/\/taki-lab.site\/bocci\/?p=1891\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u3010Laravel\u3011\u3010\u30db\u30c6\u30eb\u4e88\u7d04\u7ba1\u7406\u3011\u4e88\u7d04\u4e00\u89a7\u306b\u90e8\u5c4b\u3092\u9023\u643a\u3055\u305b\u308b<\/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_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\u4e88\u7d04\u4e00\u89a7\u306b\u90e8\u5c4b\u3092\u9023\u643a\u3055\u305b\u308b\n#TechCommit","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},"jetpack_post_was_ever_published":false},"categories":[3],"tags":[138,79],"class_list":["post-1891","post","type-post","status-publish","format-standard","hentry","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-uv","jetpack-related-posts":[{"id":1899,"url":"https:\/\/taki-lab.site\/bocci\/?p=1899","url_meta":{"origin":1891,"position":0},"title":"\u3010Laravel\u3011\u3010\u30db\u30c6\u30eb\u4e88\u7d04\u7ba1\u7406\u3011\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u3068\u90e8\u5c4b\u306e\u9023\u643a","author":"taki","date":"2019\u5e7412\u670812\u65e5","format":false,"excerpt":"\u524d\u56de\u307e\u3067\u306e\u72b6\u6cc1\u306f\u3053\u3061\u3089 https:\/\/taki-lab.site\/bocci\/?p=1891 \u6700\u65b0\u2026","rel":"","context":"\u6280\u8853","block_context":{"text":"\u6280\u8853","link":"https:\/\/taki-lab.site\/bocci\/?cat=3"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-12-08-43-36.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2161,"url":"https:\/\/taki-lab.site\/bocci\/?p=2161","url_meta":{"origin":1891,"position":1},"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":2045,"url":"https:\/\/taki-lab.site\/bocci\/?p=2045","url_meta":{"origin":1891,"position":2},"title":"\u3010Laravel\u3011\u3010Vue.js\u3011\u3010\u30db\u30c6\u30eb\u4e88\u7d04\u7ba1\u7406\u3011\u4e88\u7d04\u306e\u524a\u9664\u3092\u5b9f\u88c5\u3059\u308b","author":"taki","date":"2019\u5e7412\u670826\u65e5","format":false,"excerpt":"\u524d\u56de\u307e\u3067\u306e\u72b6\u6cc1\u306f\u3053\u3061\u3089 https:\/\/taki-lab.site\/bocci\/?p=2040 \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\/2019\/12\/Screenshot-from-2019-12-26-11-12-07.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1922,"url":"https:\/\/taki-lab.site\/bocci\/?p=1922","url_meta":{"origin":1891,"position":3},"title":"\u3010Laravel\u3011\u3010\u30db\u30c6\u30eb\u4e88\u7d04\u7ba1\u7406\u3011\u90e8\u5c4b\u3067\u30d5\u30a3\u30eb\u30bf\u3092\u304b\u3051\u308b","author":"taki","date":"2019\u5e7412\u670814\u65e5","format":false,"excerpt":"\u524d\u56de\u307e\u3067\u306e\u72b6\u6cc1\u306f\u3053\u3061\u3089 https:\/\/taki-lab.site\/bocci\/?p=1908 \u6700\u65b0\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\/12\/Screenshot-from-2019-12-14-07-44-51.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-14-07-44-51.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-14-07-44-51.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-14-07-44-51.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":2059,"url":"https:\/\/taki-lab.site\/bocci\/?p=2059","url_meta":{"origin":1891,"position":4},"title":"\u3010Laravel\u3011\u3010Vue.js\u3011\u3010\u30db\u30c6\u30eb\u4e88\u7d04\u7ba1\u7406\u3011\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8\u4e00\u89a7\u3092\u8868\u793a","author":"taki","date":"2019\u5e7412\u670827\u65e5","format":false,"excerpt":"\u524d\u56de\u307e\u3067\u306e\u72b6\u6cc1\u306f\u3053\u3061\u3089 https:\/\/taki-lab.site\/bocci\/?p=2045 \u4e88\u7d04\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\/2019\/12\/Screenshot-from-2019-12-27-08-52-50.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-27-08-52-50.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-27-08-52-50.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-27-08-52-50.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":2005,"url":"https:\/\/taki-lab.site\/bocci\/?p=2005","url_meta":{"origin":1891,"position":5},"title":"\u3010Laravel\u3011\u3010Vue.js\u3011\u3010\u30db\u30c6\u30eb\u4e88\u7d04\u7ba1\u7406\u3011\u4e88\u7d04\u8a73\u7d30\u3092\u30c0\u30a4\u30a2\u30ed\u30b0\u306b\u8868\u793a\u3055\u305b\u308b","author":"taki","date":"2019\u5e7412\u670823\u65e5","format":false,"excerpt":"\u524d\u56de\u307e\u3067\u306e\u72b6\u6cc1\u306f\u3053\u3061\u3089 https:\/\/taki-lab.site\/bocci\/?p=1987 \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\/2019\/12\/Screenshot-from-2019-12-23-07-59-53.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-23-07-59-53.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-23-07-59-53.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts\/1891","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=1891"}],"version-history":[{"count":2,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts\/1891\/revisions"}],"predecessor-version":[{"id":1897,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts\/1891\/revisions\/1897"}],"wp:attachment":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1891"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}