{"id":7407,"date":"2020-06-08T15:00:50","date_gmt":"2020-06-08T06:00:50","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=7407"},"modified":"2020-05-27T05:33:47","modified_gmt":"2020-05-26T20:33:47","slug":"%e3%80%90laravel%e3%80%91%e3%83%aa%e3%83%ac%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%b7%e3%83%83%e3%83%97%e3%81%a7%e3%81%9c%e3%81%b2%e7%9f%a5%e3%81%a3%e3%81%a6%e3%81%bb%e3%81%97%e3%81%84sync","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=7407","title":{"rendered":"\u3010Laravel\u3011\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u3067\u305c\u3072\u77e5\u3063\u3066\u307b\u3057\u3044sync()\u30e1\u30bd\u30c3\u30c9"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u30d6\u30ed\u30b0\u3067\u306f\u4e88\u7d04\u6295\u7a3f\u3092\u3057\u3066\u3044\u308b\u306e\u3067\u5b9f\u306f\u3053\u306e\u8a18\u4e8b\u306f\u4e45\u3057\u3076\u308a\u306b\u66f8\u3044\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u306a\u305c\u8a18\u4e8b\u3092\u66f8\u304f\u305f\u304f\u306a\u3063\u305f\u304b\u3068\u8a00\u3046\u3068\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">\u300c\u3053\u308c\u306f\u3082\u3063\u3068\u65e9\u304f\u77e5\u3063\u3066\u304a\u304d\u305f\u304b\u3063\u305f\ud83d\ude02\u300d<\/strong><\/p>\n<p>\u3068\u3044\u3046\u6a5f\u80fd\u306b\u906d\u9047\u3057\u305f\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>\u5b9f\u306f\u3053\u306e\u6a5f\u80fd\u306f<code>Laravel 4.2<\/code>\u3067\u3082\u4f7f\u3048\u308b\u306e\u3067\u3001\u3082\u3046\u4f7f\u3063\u3066\u308b\u4eba\u304b\u3089\u3059\u308b\u3068\u300c\u5f53\u305f\u308a\u524d\u3058\u3083\u3093\u30fb\u30fb\u30fb\u300d\u3068\u306a\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u5148\u65e5\u305d\u306e\u4fbf\u5229\u3055\u3092\u5b9f\u611f\u3057\u305f\u306e\u3067\u305c\u3072\u8a18\u4e8b\u3068\u3057\u3066\u304a\u5c4a\u3051\u3057\u305f\u304f\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u5177\u4f53\u7684\u306b\u8a00\u3046\u3068\u3001\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u306e\u4fdd\u5b58\u306b\u4f7f\u3046\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">sync()<\/strong><\/p>\n<p>\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u3068\u3001<strong>\u3044\u3061\u3044\u3061\u30c7\u30fc\u30bf\u524a\u9664\u3084\u3001\u5b58\u5728\u30c1\u30a7\u30c3\u30af\u3092\u305b\u305a\u306b\u9023\u7d50\u30c6\u30fc\u30d6\u30eb\u306e\u30c7\u30fc\u30bf\u66f4\u65b0\u304c\u3067\u304d\u3061\u3083\u3046\u30b9\u30b0\u30ec\u30e2\u30ce\u306a\u3093\u3067\u3059\u306d\ud83d\udc4d<\/strong><\/p>\n<p>\u305d\u3053\u3067\u2757<\/p>\n<p>\u4eca\u56de\u306f\u7701\u30b3\u30fc\u30c9\u3092\u5b9f\u73fe\u3067\u304d\u308b\u3001\u3053\u306e<code>sync()<\/code>\u30e1\u30bd\u30c3\u30c9\u306e\u4f7f\u3044\u65b9\u3092\u3054\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u306e\u304a\u5f79\u306b\u7acb\u3066\u308b\u3068\u5b09\u3057\u3044\u3067\u3059\ud83d\ude0a\u2728<br \/>\n\uff08\u306a\u304a\u3001\u304a\u307e\u3051\u7684\u306a\u30ab\u30f3\u30b8\u3067\u4e2d\u9593\u30c6\u30fc\u30d6\u30eb\u306b\u3064\u3044\u3066\u3082\u8aac\u660e\u3057\u3066\u3044\u307e\u3059\uff09<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3566 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png\" alt=\"\" width=\"306\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png 306w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1-287x300.png 287w\" sizes=\"auto, (max-width: 306px) 100vw, 306px\" \/>\u300c\u3084\u3063\u3071\u308a\u30d6\u30ed\u30b0\u66f8\u304f\u306e\u697d\u3057\u3044\u3067\u3059\u306d\u2757\u300d<\/p>\n<p><strong>\u5b9f\u884c\u74b0\u5883\uff1a<\/strong> Laravel 7.x<\/p>\n<h1>\u3069\u3093\u306a\u5834\u5408\u306b\u4fbf\u5229\uff1f\uff1f<\/h1>\n<p><code>sync()<\/code>\u306f\u3001\u5192\u982d\u3067\u3082\u8aac\u660e\u3057\u305f\u3068\u304a\u308a\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u5148\u306e\u30c7\u30fc\u30bf\u3092\u7c21\u5358\u306b\u66f4\u65b0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u300c<strong>\u5404\u30e6\u30fc\u30b6\u30fc\u304c\u3069\u3093\u306a\u8da3\u5473\uff08\u8907\u6570OK\uff09\u3092\u3082\u3063\u3066\u3044\u308b\u304b<\/strong>\u300d\u3092DB\u3067\u7d50\u5408\u3057\u3066\u3044\u308b\u5834\u5408\u3092\u8003\u3048\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u3068\u3057\u3066\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u592a\u90ce\u3055\u3093\uff08\u8da3\u5473\uff1a \u30c6\u30cb\u30b9\u3001\u30b4\u30eb\u30d5\u3001\u30b8\u30e7\u30ae\u30f3\u30b0\uff09<\/li>\n<li>\u6b21\u90ce\u3055\u3093\uff08\u8da3\u5473\uff1a \u9676\u82b8\uff09<\/li>\n<li>\u4e09\u90ce\u3055\u3093\uff08\u8da3\u5473\uff1a \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3001\u4f5c\u66f2\uff09<\/li>\n<\/ul>\n<p>\u3067\u306f\u3001\u3053\u306e\u524d\u63d0\u3067\u592a\u90ce\u3055\u3093\u306e\u8da3\u5473\u3092<code>sync()<\/code>\u3067\u5909\u66f4\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>$user = \\App\\User::find(1);\r\n$user-&gt;hobbies()-&gt;<strong>sync([1, 2, 3]);<\/strong> \/\/ hobbies\u306eID\u304c1, 2, 3\u306e\u3082\u306e\u306b\u66f4\u65b0<\/pre>\n<p>\u306f\u3044\u2757\u305f\u3063\u305f\u3053\u308c\u3060\u3051\u3067\u3001<strong>\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u5148\u306e\u4e2d\u8eab\u3092\u5165\u308c\u66ff\u3048\u3066\u304f\u308c\u307e\u3059\u3002<\/strong>\uff08\u3082\u3061\u308d\u3093\u65b0\u898f\u8ffd\u52a0\u306e\u5834\u5408\u3082OK\u3067\u3059\uff09<\/p>\n<p>\u3067\u306f\u3001\u3053\u3053\u304b\u3089\u306f\u5b9f\u969b\u306b\u3069\u3046\u3064\u304f\u3063\u3066\u3044\u304f\u304b\u3092\u307f\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002\uff08\u4e2d\u9593\u30c6\u30fc\u30d6\u30eb\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u304c\u3093\u3070\u308a\u307e\u3059\ud83d\ude0a\ud83d\udc4d\uff09<\/p>\n<h1>\u30e6\u30fc\u30b6\u30fc\u306e\u8da3\u5473\u3092\u7ba1\u7406\u3059\u308b\u6a5f\u80fd\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u5148\u307b\u3069\u66f8\u3044\u305f\u300c<strong>\u5404\u30e6\u30fc\u30b6\u30fc\u304c\u3069\u3093\u306a\u8da3\u5473\uff08\u8907\u6570OK\uff09\u3092\u3082\u3063\u3066\u3044\u308b\u304b<\/strong>\u300d\u3092\u7ba1\u7406\u3059\u308b\u6a5f\u80fd\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u304c\u3059\u3067\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3001\u3055\u3089\u306b\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u308b\u30e6\u30fc\u30b6\u30fc\u30c7\u30fc\u30bf\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u524d\u63d0\u3067\u3059\u3002<\/p>\n<p>\u307e\u3060\u306e\u65b9\u306f<a href=\"https:\/\/blog.capilano-fw.com\/?p=4576\">Laravel6.x\u4ee5\u964d\u3067\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5<\/a>\u3092\u53c2\u8003\u306b\u3057\u3066\u5b9f\u884c\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u30c6\u30fc\u30d6\u30eb\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7358\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_review_11.png\" alt=\"\" width=\"526\" height=\"461\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_review_11.png 526w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_review_11-300x263.png 300w\" sizes=\"auto, (max-width: 526px) 100vw, 526px\" \/><\/p>\n<h2>\u30e2\u30c7\u30eb\uff06\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u3064\u304f\u308b<\/h2>\n<p>\u307e\u305a\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u307e\u308f\u308a\u304b\u3089\u5b9f\u88c5\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<br \/>\n\u5fc5\u8981\u306a\u306e\u306f\u3001\u5168\u90e8\u3067\u4ee5\u4e0b\u306e\uff13\u30c6\u30fc\u30d6\u30eb\u3067\u3059\u3002<\/p>\n<ul>\n<li>users\uff1a \u30e6\u30fc\u30b6\u30fc\uff08\u4f5c\u6210\u6e08\u307f\uff09<\/li>\n<li>hobbies\uff1a \u8da3\u5473<\/li>\n<li>user_hobbies\uff1a \u30e6\u30fc\u30b6\u30fc\u3068\u8da3\u5473\u306e\u4e2d\u9593\u30c6\u30fc\u30d6\u30eb<\/li>\n<\/ul>\n<p>\u3067\u306f\u3001\u5148\u306b<code>hobbies<\/code>\u304b\u3089\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:model Hobby -m<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u30e2\u30c7\u30eb\u3068\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u4e00\u6c17\u306b\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u4e2d\u8eab\u3092\u6b21\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p><strong><code>\/database\/migrations\/****_**_**_******_create_hobbies_table.php<\/code><\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function up()\r\n{\r\n    Schema::create('hobbies', function (Blueprint $table) {\r\n        $table-&gt;id();\r\n        <strong>$table-&gt;string('name')-&gt;comment('\u8da3\u5473\u306e\u540d\u524d'); \/\/ \ud83d\udc48\u8ffd\u52a0<\/strong>\r\n        $table-&gt;timestamps();\r\n    });\r\n}\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<p>\u6b21\u306b\u4e2d\u9593\u30c6\u30fc\u30d6\u30eb\u306e<code>user_hobbies<\/code>\u3067\u3059\u3002<br \/>\n\u540c\u3058\u304f\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:model UserHobby -m<\/strong><\/pre>\n<p>\u305d\u3057\u3066\u3001\u3053\u3061\u3089\u3082\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p><strong><code>\/database\/migrations\/****_**_**_******_create_user_hobbies_table.php<\/code><\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function up()\r\n{\r\n    Schema::create('user_hobbies', function (Blueprint $table) {\r\n        $table-&gt;id();\r\n        <strong>$table-&gt;unsignedBigInteger('user_id')-&gt;comment('\u30e6\u30fc\u30b6\u30fcID'); \/\/ \ud83d\udc48 \u8ffd\u52a0<\/strong>\r\n<strong>        $table-&gt;unsignedBigInteger('hobby_id')-&gt;comment('\u8da3\u5473ID'); \/\/ \ud83d\udc48 \u8ffd\u52a0<\/strong>\r\n\/\/      $table-&gt;timestamps(); \/\/ \u4e0d\u8981\u306a\u306e\u3067\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\r\n\r\n<strong>        $table-&gt;foreign('user_id')-&gt;references('id')-&gt;on('users'); \/\/ \ud83d\udc48 \u8ffd\u52a0<\/strong>\r\n<strong>        $table-&gt;foreign('hobby_id')-&gt;references('id')-&gt;on('hobbies'); \/\/ \ud83d\udc48 \u8ffd\u52a0<\/strong>\r\n    });\r\n}\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<p>\u3067\u306f\u3001\u3053\u306e\u72b6\u614b\u3067\u3044\u3063\u305f\u3093\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>php artisan migrate<\/strong><\/pre>\n<p>\u5404\u30c6\u30fc\u30d6\u30eb\u306f\u3053\u3046\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7409\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_1.png\" alt=\"\" width=\"356\" height=\"315\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_1.png 356w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_1-300x265.png 300w\" sizes=\"auto, (max-width: 356px) 100vw, 356px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7410\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_2.png\" alt=\"\" width=\"348\" height=\"232\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_2.png 348w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_2-300x200.png 300w\" sizes=\"auto, (max-width: 348px) 100vw, 348px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7411\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_3.png\" alt=\"\" width=\"351\" height=\"209\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_3.png 351w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_3-300x179.png 300w\" sizes=\"auto, (max-width: 351px) 100vw, 351px\" \/><\/p>\n<h2>\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u3064\u304f\u308b<\/h2>\n<p>\u3067\u306f\u3001\u307e\u3060\u8da3\u5473\u30c6\u30fc\u30d6\u30eb\u306b\u306f\u30c7\u30fc\u30bf\u304c\u5b58\u5728\u3057\u306a\u3044\u306e\u3067<code>Seeder\u6a5f\u80fd<\/code>\u3067\u4ee5\u4e0b\u306e\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<ul>\n<li>\u30c6\u30cb\u30b9<\/li>\n<li>\u30b4\u30eb\u30d5<\/li>\n<li>\u30b8\u30e7\u30ae\u30f3\u30b0<\/li>\n<li>\u9676\u82b8<\/li>\n<li>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0<\/li>\n<li>\u4f5c\u66f2<\/li>\n<\/ul>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:seed HobbiesTableSeeder<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u4e2d\u8eab\u3092\u6b21\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p><strong><code>\/database\/seeds\/HobbiesTableSeeder.php<\/code><\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function run()\r\n{\r\n    <strong>$hobby_names = [<\/strong>\r\n<strong>        '\u30c6\u30cb\u30b9',<\/strong>\r\n<strong>        '\u30b4\u30eb\u30d5',<\/strong>\r\n<strong>        '\u30b8\u30e7\u30ae\u30f3\u30b0',<\/strong>\r\n<strong>        '\u9676\u82b8',<\/strong>\r\n<strong>        '\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0',<\/strong>\r\n<strong>        '\u4f5c\u66f2'<\/strong>\r\n<strong>    ];<\/strong>\r\n\r\n<strong>    foreach ($hobby_names as $hobby_name) {<\/strong>\r\n\r\n<strong>        $hobby = new \\App\\Hobby();<\/strong>\r\n<strong>        $hobby-&gt;name = $hobby_name;<\/strong>\r\n<strong>        $hobby-&gt;save();<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n}\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<p>\u6b21\u306b\u4f5c\u6210\u3057\u305f<code>HobbiesTableSeeder<\/code>\u3092<code>Laravel<\/code>\u306b\u767b\u9332\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong><code>\/database\/seeds\/DatabaseSeeder.php<\/code><\/strong><\/p>\n<pre>public function run()\r\n{\r\n     \/\/ \u7701\u7565\r\n\r\n     <strong>$this-&gt;call(HobbiesTableSeeder::class); \/\/ \ud83d\udc48 \u8ffd\u52a0<\/strong>\r\n}<\/pre>\n<p>\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066DB\u3092\u30ea\u30bb\u30c3\u30c8\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>php artisan migrate:fresh --seed<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u30c6\u30fc\u30d6\u30eb\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7414\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_4.png\" alt=\"\" width=\"523\" height=\"393\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_4.png 523w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_4-300x225.png 300w\" sizes=\"auto, (max-width: 523px) 100vw, 523px\" \/><\/p>\n<h2>\u4e2d\u9593\u30c6\u30fc\u30d6\u30eb\u306e\u8003\u3048\u65b9<\/h2>\n<p>\u3053\u3053\u3067\u4e2d\u9593\u30c6\u30fc\u30d6\u30eb\u306e\u8003\u3048\u65b9\u3092\u3067\u304d\u308b\u3060\u3051\u30b7\u30f3\u30d7\u30eb\u306b\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<br \/>\n\u307e\u305a\u56f3\u3092\u898b\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7412\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_medium_table.png\" alt=\"\" width=\"640\" height=\"284\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_medium_table.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_medium_table-300x133.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u4e2d\u9593\u30c6\u30fc\u30d6\u30eb\u306f\uff12\u3064\u306e\u30c6\u30fc\u30d6\u30eb\uff08\u4e0a\u306e\u4f8b\u3067\u306f\u300c\u30e6\u30fc\u30b6\u30fc\u300d\u3068\u300c\u8da3\u5473\u300d\uff09\u3092\u3064\u306a\u3050\u305f\u3081\u3060\u3051\u306b\u5b58\u5728\u3057\u3066\u3044\u308b\u30c6\u30fc\u30d6\u30eb\u3067\u3059\u3002\u305d\u306e\u305f\u3081\u3001<strong>\uff11\u884c\u3054\u3068\u306b\uff12\u3064\u306e\u5404ID\u3092\u4fdd\u5b58\u3057\u3066\u3044\u307e\u3059\u3002<\/strong><\/p>\n<p>\u203b\u3064\u307e\u308a\u3001<strong>\u4e2d\u9593\u30c6\u30fc\u30d6\u30eb\u306f\u300c\u5ddd\u306b\u67b6\u304b\u3063\u305f\u6a4b\u300d\u3092\u30a4\u30e1\u30fc\u30b8\u3059\u308b\u3068\u5206\u304b\u308a\u3084\u3059\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/strong>\u6a4b\u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u3053\u3068\u3067\u304a\u4e92\u3044\u3092\u3064\u306a\u3050\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u3046\u3059\u308b\u3053\u3068\u3067\u3001\u300c\u30e6\u30fc\u30b6\u30fc\u300d\u3082\u300c\u8da3\u5473\u300d\u3082\u3059\u3063\u304d\u308a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u69cb\u6210\u3067\u5b9f\u88c5\u3067\u304d\u308b\u3068\u8a33\u3067\u3059\u306d\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u3055\u3089\u306b\u3053\u306e\u4e2d\u9593\u30c6\u30fc\u30d6\u30eb\u3068\u3044\u3046\u300c\u6a4b\u300d\u306f\u30e6\u30fc\u30b6\u30fc\u5074\u3001\u8da3\u5473\u5074\u3069\u3061\u3089\u304b\u3089\u3067\u3082\u901a\u308c\u308b\u306e\u3067\u3001\u9006\u306b\u300c\u8da3\u5473\u300d\u3092\u30e1\u30a4\u30f3\u306b\u8003\u3048\u305f\u3068\u304d\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u304c\u3064\u304f\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7413\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_medium_table_2.png\" alt=\"\" width=\"640\" height=\"284\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_medium_table_2.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_medium_table_2-300x133.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u3064\u307e\u308a\u3001\u300c\u591a\u5bfe\u591a\u300d\u306e\u9023\u7d50\u3067\u3059\u306d\u3002<\/p>\n<h2>\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u3092\u3064\u304f\u308b<\/h2>\n<p>\u3067\u306f\u3001\u5148\u307b\u3069\u8aac\u660e\u3057\u305f\u4e2d\u9593\u30c6\u30fc\u30d6\u30eb\u3092\u4f7f\u3063\u3066\u300c<strong>\u5404\u30e6\u30fc\u30b6\u30fc\u304c\u3069\u3093\u306a\u8da3\u5473\uff08\u8907\u6570OK\uff09\u3092\u3082\u3063\u3066\u3044\u308b\u304b<\/strong>\u300d\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u3092\u3064\u304f\u308a\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong><code>\/app\/User.php<\/code><\/strong><\/p>\n<pre>&lt;?php\r\n\r\n\/\/ \u7701\u7565\r\n\r\nclass User extends Authenticatable\r\n{\r\n    \/\/ \u7701\u7565\r\n\r\n    \/\/ \u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\r\n    <strong>public function hobbies() { \/\/ \ud83d\udc48 \u8ffd\u52a0<\/strong>\r\n\r\n<strong>        return $this-&gt;belongsToMany('App\\Hobby', 'App\\UserHobby');<\/strong>\r\n\r\n<strong>    }<\/strong><\/pre>\n<p>\u3055\u3042\u3001\u3053\u308c\u3067<code>sync()<\/code>\u304c\u4f7f\u3048\u308b\u74b0\u5883\u304c\u6574\u3044\u307e\u3057\u305f\u2757<\/p>\n<h2>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h2>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u307e\u305a\u306f\u592a\u90ce\u3055\u3093\u306b\u4ee5\u4e0b\uff13\u3064\u306e\u8da3\u5473\u3092\u3082\u305f\u305b\u3066\u307f\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30c6\u30cb\u30b9\uff08ID: 1\uff09<\/li>\n<li>\u30b4\u30eb\u30d5\uff08ID: 2\uff09<\/li>\n<li>\u30b8\u30e7\u30ae\u30f3\u30b0\uff08ID: 3\uff09<\/li>\n<\/ul>\n<p><strong><code>routes\/web.php<\/code><\/strong><\/p>\n<pre>\/\/ \u7701\u7565<strong>\r\n\r\nRoute::get('sync', function(){<\/strong>\r\n\r\n<strong>    $hobby_ids = [<\/strong>\r\n<strong>        1, \/\/ \u30c6\u30cb\u30b9<\/strong>\r\n<strong>        2, \/\/ \u30b4\u30eb\u30d5<\/strong>\r\n<strong>        3, \/\/ \u30b8\u30e7\u30ae\u30f3\u30b0<\/strong>\r\n<strong>    ];<\/strong>\r\n\r\n<strong>    $user = \\App\\User::find(1); \/\/ \u592a\u90ce\u3055\u3093<\/strong>\r\n<strong>    $user-&gt;hobbies()-&gt;sync($hobby_ids);<\/strong>\r\n\r\n<strong>});<\/strong><\/pre>\n<p>\u203b\u672c\u6765\u306f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306b\u66f8\u304f\u3079\u304d\u3067\u3059\u304c\u30c6\u30b9\u30c8\u306a\u306e\u3067\u76f4\u63a5\u30eb\u30fc\u30c8\u306b\u66f8\u3044\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u300c<strong>http:\/\/******\/sync<\/strong>\u300d\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068<code>user_hobbies<\/code>\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7416\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_5.png\" alt=\"\" width=\"405\" height=\"317\" \/><\/p>\n<p>\u6570\u5b57\u3060\u3051\u306a\u306e\u3067\u5206\u304b\u308a\u306b\u304f\u3044\u3067\u3059\u304c\u3001\u592a\u90ce\u3055\u3093\uff08user_id: 1\uff09\u306e\u30c7\u30fc\u30bf\u304c\uff13\u3064\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u306e\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u304c\u4e0a\u624b\u304f\u3044\u3063\u3066\u3044\u308b\u304b\u30b3\u30fc\u30c9\u3092\u5909\u66f4\u3057\u3066\u4e2d\u8eab\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong><code>routes\/web.php<\/code><\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\nRoute::get('sync', function(){\r\n\r\n    <strong>$user = \\App\\User::with('hobbies')-&gt;find(1);<\/strong>\r\n<strong>    dd($user-&gt;toArray());<\/strong>\r\n\r\n});<\/pre>\n<p>\u30d6\u30e9\u30a6\u30b6\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7419\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_6.png\" alt=\"\" width=\"319\" height=\"554\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_6.png 319w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_6-173x300.png 173w\" sizes=\"auto, (max-width: 319px) 100vw, 319px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u592a\u90ce\u3055\u3093\u306b\u300c\u30c6\u30cb\u30b9\u300d\u300c\u30b4\u30eb\u30d5\u300d\u300c\u30b8\u30e7\u30ae\u30f3\u30b0\u300d\u304c\u9023\u7d50\u3067\u304d\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u305d\u306e\u5f8c\u3001\u592a\u90ce\u3055\u3093\u304c\u30b4\u30eb\u30d5\u3092\u3084\u3081\u3066\u3057\u307e\u3063\u3066\u3001\u4f5c\u66f2\u3092\u8da3\u5473\u3068\u3057\u3066\u306f\u3058\u3081\u305f\u5834\u5408\u3092\u8003\u3048\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u73fe\u5728\u306e\u592a\u90ce\u3055\u3093\u306e\u8da3\u5473\u306f\u4ee5\u4e0b\uff13\u3064\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30c6\u30cb\u30b9\uff08ID: 1\uff09<\/li>\n<li>\u30b8\u30e7\u30ae\u30f3\u30b0\uff08ID: 3\uff09<\/li>\n<li>\u4f5c\u66f2\uff08ID: 6\uff09<\/li>\n<\/ul>\n<p>\u3053\u3053\u304c<code>sync()<\/code>\u306e\u3059\u3054\u3044\u3068\u3053\u308d\u306a\u306e\u3067\u3059\u304c\u3001\u5b9f\u306f\u30b3\u30fc\u30c9\u306f\u307b\u307c\u540c\u3058\u3067<strong>\u8da3\u5473ID\u3060\u3051\u3092\u5909\u66f4\u3059\u308b\u3060\u3051\u3067OK\u3067\u3059\u3002<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\nRoute::get('sync', function(){\r\n\r\n    <strong>$hobby_ids = [ \/\/ \ud83d\udc48 \u3053\u3053\u3092\u5909\u66f4\u3059\u308b\u3060\u3051<\/strong>\r\n<strong>        1, \/\/ \u30c6\u30cb\u30b9<\/strong>\r\n<strong>        3, \/\/ \u30b8\u30e7\u30ae\u30f3\u30b0<\/strong>\r\n<strong>        6, \/\/ \u4f5c\u66f2<\/strong>\r\n<strong>    ];<\/strong>\r\n\r\n    $user = \\App\\User::find(1);\r\n    $user-&gt;hobbies()-&gt;sync(<strong>$hobby_ids<\/strong>);\r\n\r\n});<\/pre>\n<p>\u3067\u306f\u3001\u3053\u306e\u72b6\u614b\u3067\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3057\u305f\u5f8c\u3001<code>user_hobbies<\/code>\u30c6\u30fc\u30d6\u30eb\u3092\u898b\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7420\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_7.png\" alt=\"\" width=\"405\" height=\"318\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_7.png 405w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_7-300x236.png 300w\" sizes=\"auto, (max-width: 405px) 100vw, 405px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n<code>hobby_id<\/code>\u304c<code>sync()<\/code>\u3067\u6307\u5b9a\u3057\u305f\uff13\u3064\u306b\u5909\u66f4\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u203b\u3055\u3089\u306b<code>id<\/code>\u306b\u6ce8\u76ee\u3057\u3066\u3044\u305f\u3060\u304d\u305f\u3044\u306e\u3067\u3059\u304c\u3001<code>sync()<\/code>\u306f\u4e00\u65e6\u3059\u3079\u3066\u524a\u9664\u3057\u3066\u30c7\u30fc\u30bf\u8ffd\u52a0\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u306a\u3044\u3082\u306e\u306f\u4ee5\u524d\u306e\u307e\u307e\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u3053\u3061\u3089\u3082\u30c7\u30fc\u30bf\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7421\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_8.png\" alt=\"\" width=\"319\" height=\"547\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_8.png 319w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/05\/laravel_sync_8-175x300.png 175w\" sizes=\"auto, (max-width: 319px) 100vw, 319px\" \/><\/p>\n<p>\u3046\u307e\u304f\u5909\u66f4\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n<span style=\"font-size: 1rem;\">\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f<\/span>\ud83d\ude0a\u2728<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f<code>Laravel<\/code>\u3067\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u5148\u306e\u30c7\u30fc\u30bf\u3092\u66f4\u65b0\u3059\u308b\u6642\u306b\u3068\u3066\u3082\u4fbf\u5229\u306a<code>sync()<\/code>\u30e1\u30bd\u30c3\u30c9\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n<p><code>sync()<\/code>\u3092\u4f7f\u3048\u3070\u3001\u3044\u3061\u3044\u3061\u4e2d\u9593\u30c6\u30fc\u30d6\u30eb\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u3001\u524a\u9664\u3057\u3066\u3001\u8ffd\u52a0\u3059\u308b\u30fb\u30fb\u30fb\u3088\u3046\u306a\u30b3\u30fc\u30c9\u306f\u4e0d\u8981\u306b\u306a\u308b\u306e\u3067\u3001\u6642\u77ed\u3067\u304d\u307e\u3059\u3057\u3001\u30b3\u30fc\u30c9\u304c\u6e1b\u308b\u30a4\u30b3\u30fc\u30eb\u9593\u9055\u3044\u3082\u5c11\u306a\u304f\u306a\u308b\u306e\u3067\u30e1\u30ea\u30c3\u30c8\u306f\u591a\u3044\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u3082\u6d3b\u7528\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6068 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_12.png\" alt=\"\" width=\"226\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_12.png 226w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_12-212x300.png 212w\" sizes=\"auto, (max-width: 226px) 100vw, 226px\" \/><span style=\"font-size: 1rem;\">\u300c\u5916\u51fa\u81ea\u7c9b\u304c\u660e\u3051\u305f\u306e\u3067<\/span><br \/>\n\u3084\u3063\u3068\u9aea\u306e\u6bdb\u3092\u5207\u308a\u306b\u884c\u3051\u307e\u3057\u305f\uff08\u30b5\u30c3\u30d1\u30ea\uff01\uff09\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u30d6\u30ed\u30b0\u3067\u306f\u4e88\u7d04\u6295\u7a3f\u3092\u3057\u3066\u3044\u308b\u306e\u3067\u5b9f\u306f\u3053\u306e\u8a18\u4e8b\u306f\u4e45\u3057\u3076\u308a\u306b\u66f8\u3044\u3066\u3044\u307e\u3059\u3002 \u306a\u305c\u8a18\u4e8b\u3092\u66f8\u304f\u305f\u304f\u306a\u3063\u305f\u304b\u3068\u8a00\u3046\u3068\u3001 \u300c\u3053\u308c\u306f\u3082\u3063\u3068\u65e9\u304f\u77e5\u3063\u3066\u304a\u304d\u305f\u304b\u3063\u305f &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=7407\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u3010Laravel\u3011\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u3067\u305c\u3072\u77e5\u3063\u3066\u307b\u3057\u3044sync()\u30e1\u30bd\u30c3\u30c9&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":7428,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[67],"class_list":["post-7407","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","tag-67"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/7407","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7407"}],"version-history":[{"count":7,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/7407\/revisions"}],"predecessor-version":[{"id":7429,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/7407\/revisions\/7429"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/7428"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}