{"id":2114,"date":"2018-11-07T01:58:55","date_gmt":"2018-11-06T16:58:55","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=2114"},"modified":"2020-04-22T16:59:33","modified_gmt":"2020-04-22T07:59:33","slug":"%e5%85%a816%e5%ae%9f%e4%be%8b%ef%bc%81laravel%e3%81%ae%e3%83%a2%e3%83%87%e3%83%ab%e3%81%a7%e4%bd%bf%e3%81%88%e3%82%8b%e3%83%a1%e3%83%b3%e3%83%90%e5%a4%89%e6%95%b0","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=2114","title":{"rendered":"\u516816\u5b9f\u4f8b\uff01Laravel\u306e\u30e2\u30c7\u30eb\u3067\u4f7f\u3048\u308b\u30e1\u30f3\u30d0\u5909\u6570"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001Laravel\u306e\u30e2\u30c7\u30eb\uff08Eloquent\uff09\u3068\u3044\u3048\u3070\u958b\u767a\u8005\u304c\u559c\u3076\u300c\u304b\u3086\u3044\u3068\u3053\u308d\u306b\u624b\u304c\u5c4a\u304f\u300d\u6a5f\u80fd\u304c\u305f\u304f\u3055\u3093\u3064\u3044\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001<strong>\u4eca\u56de\u306f\u305d\u306e\u4e2d\u3067\u3082\u300c\u30e1\u30f3\u30d0\u5909\u6570\u300d\u306b\u30d5\u30a9\u30fc\u30ab\u30b9\u3092\u5f53\u3066\u3066\u307f\u307e\u3059\u3002<\/strong><\/p>\n<p>\u30e1\u30f3\u30d0\u5909\u6570\u3067\u6709\u540d\u306a\u3082\u306e\u3067\u3044\u3046\u3068<code>$guarded<\/code>\u3084<code>$casts<\/code>\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3053\u308c\u3089\u306e\u5909\u6570\u3092\u6307\u5b9a\u3057\u3066\u304a\u304f\u3060\u3051\u3067\u3001\u30e2\u30c7\u30eb\u306b\u69d8\u3005\u306a\u8a2d\u5b9a\u3084\u5236\u9650\u3092\u3064\u304f\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3001\u3088\u308a\u30d5\u30ec\u30ad\u30b7\u30d6\u30eb\u306a\u958b\u767a\u3092\u9032\u3081\u3089\u308c\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u77e5\u3063\u3066\u304a\u3044\u3066\u640d\u306f\u306a\u3044\u3067\u6a5f\u80fd\u3068\u8a00\u3063\u3066\u3044\u3044\u3067\u3057\u3087\u3046\u3002\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u305c\u3072<code>Laravel<\/code>\u3092\u52c9\u5f37\u4e2d\u306e\u65b9\u306f\u53c2\u8003\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-418 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/35.png\" alt=\"\" width=\"370\" height=\"240\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/35.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/35-300x195.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/p>\n<p><strong>\u5b9f\u884c\u74b0\u5883\uff1a<\/strong> Laravel 5.7, MySQL 5.7<\/p>\n<h1>\u30e1\u30f3\u30d0\u5909\u6570\u306e\u8a2d\u5b9a\u65b9\u6cd5<\/h1>\n<p>\u307e\u305a\u306f\u8a2d\u5b9a\u65b9\u6cd5\u3067\u3059\u304c\u3001\u3068\u3066\u3082\u7c21\u5358\u3067\u3059\u3002<br \/>\n\u6b21\u306e\u3088\u3046\u306b\u30e2\u30c7\u30eb\u306e\u30af\u30e9\u30b9\u5185\u306b\u5909\u6570\u3092\u6307\u5b9a\u3059\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<pre>&lt;?php\r\n\r\nnamespace App;\r\n\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\n\r\nclass Item extends Model\r\n{\r\n    <strong>protected $guarded = ['id'];<\/strong>\r\n}<\/pre>\n<p>\u3053\u306e\u6642\u6ce8\u610f\u304c\u5fc5\u8981\u306a\u306e\u304c\u3001<code>protected<\/code>\u306a\u3069\u306e\u30a2\u30af\u30bb\u30b9\u5236\u5fa1\u90e8\u5206\u3067\u3059\u3002\u5b9f\u306f\u8a2d\u5b9a\u304c\u53ef\u80fd\u306a\u30e1\u30f3\u30d0\u5909\u6570\u306f\u3059\u3067\u306b\u4ed6\u306e\u6240\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u305d\u3057\u3066\u3001\u6211\u3005\u304c\u30e1\u30f3\u30d0\u5909\u6570\u3092\u6307\u5b9a\u3059\u308b\u3068\u30c7\u30fc\u30bf\u3092\u4e0a\u66f8\u304d\u3092\u3059\u308b\u5f62\u306b\u306a\u308b\u306e\u3067\u3001<code>protected<\/code>\u306a\u3069\u306f\u5143\u306e\u5b9a\u7fa9\u306b\u5408\u308f\u305b\u308b\u5fc5\u8981\u304c\u3042\u308b\u3068\u3044\u3046\u308f\u3051\u3067\u3059\u306d\u3002<\/p>\n<h1>Eloquent\u30e2\u30c7\u30eb\u3067\u4f7f\u3048\u308b\u30e1\u30f3\u30d0\u5909\u6570<\/h1>\n<h2 id=\"guarded\">$guarded \u3067\u30d5\u30a3\u30fc\u30eb\u30c9\u3078\u306e\u4ee3\u5165\u3092\u62d2\u5426\u3059\u308b<\/h2>\n<p><code>create()<\/code>\u3067\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3059\u308b\u969b\u306b\u3001\u5024\u3092\u4ee3\u5165\u300c<strong>\u3055\u305b\u306a\u3044<\/strong>\u300d\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\uff08\u3064\u307e\u308a\u305d\u308c\u4ee5\u5916\u306f\u4ee3\u5165\u304c\u8a31\u53ef\u3055\u308c\u307e\u3059\uff09<\/p>\n<p>\u5b9f\u969b\u306e\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>protected $guarded = ['id'];<\/strong><\/pre>\n<p>\u307e\u305a<code>$guarded<\/code>\u3092\u4f7f\u3063\u3066<code>id<\/code>\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u5b88\u308b\u8a2d\u5b9a\u306b\u3057\u307e\u3059\u3002<br \/>\n\u305d\u3057\u3066\u3001\u6b21\u306e\u3088\u3046\u306b\u30c7\u30fc\u30bf\u8ffd\u52a0\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>\\App\\Item::create([\r\n    <strong>'id' =&gt; 9999,<\/strong>\r\n    'name' =&gt; '\u5546\u54c1\u540d'\r\n]);<\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068DB\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2115\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/guarded.png\" alt=\"\" width=\"475\" height=\"167\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/guarded.png 475w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/guarded-300x105.png 300w\" sizes=\"auto, (max-width: 475px) 100vw, 475px\" \/><\/p>\n<p><code>id<\/code>\u3092<code>9999<\/code>\u306b\u6307\u5b9a\u3057\u307e\u3057\u305f\u304c\u3001\u5b9f\u969b\u306b\u767b\u9332\u3055\u308c\u305f<code>id<\/code>\u306f\u30aa\u30fc\u30c8\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30c8\u3055\u308c\u305f\u756a\u53f7\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u203b \u305f\u3060\u3057\u3001\u3053\u306e\u8a2d\u5b9a\u306f<code>save()<\/code>\u306b\u306f\u9069\u7528\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u203b \u306a\u304a\u3001<code>create()<\/code>\u3092\u5b9f\u884c\u3059\u308b\u5834\u5408\u3001\u5fc5\u305a<code>$guarded<\/code>\u304b<a href=\"#fillable\">$fillable<\/a>\u3092\u6307\u5b9a\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h2 id=\"fillable\">$fillable \u3067\u30d5\u30a3\u30fc\u30eb\u30c9\u3078\u306e\u4ee3\u5165\u3092\u8a31\u53ef\u3059\u308b<\/h2>\n<p><code>create()<\/code>\u3067\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3059\u308b\u969b\u306b\u3001\u5024\u3092\u4ee3\u5165\u3092\u8a31\u53ef\u3059\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\uff08\u3064\u307e\u308a\u305d\u308c\u4ee5\u5916\u306f\u4ee3\u5165\u304c\u62d2\u5426\u3055\u308c\u307e\u3059\uff09<\/p>\n<p>\u5185\u5bb9\u3068\u3057\u3066\u306f\u3001<a href=\"#guarded\">$guarded<\/a>\u306e\u9006\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u305d\u3061\u3089\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>$casts \u3067\u30c7\u30fc\u30bf\u3092\u81ea\u52d5\u5909\u63db\u3059\u308b<\/h2>\n<p>DB\u304b\u3089\u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf\u3092\u81ea\u52d5\u5909\u63db\u3059\u308b\u5909\u6570\u3067\u3059\u3002\u8a73\u3057\u304f\u306f\u3001<a href=\"https:\/\/blog.capilano-fw.com\/?p=504\">\u516812\u7a2e\u985e\uff01Laravel5.6\u306e\u30ad\u30e3\u30b9\u30c8\uff08\u578b\u5909\u63db\uff09\u5b9f\u4f8b<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>$dispatchesEvents \u3067\u5404\u30a4\u30d9\u30f3\u30c8\u3092\u8a2d\u5b9a\u3059\u308b<\/h2>\n<p>DB\u306b\u5404\u64cd\u4f5c\u304c\u884c\u308f\u308c\u305f\u3068\u304d\u306b\u5b9f\u884c\u3055\u308c\u308b<strong>\u300c\u30a4\u30d9\u30f3\u30c8\u300d\u3092\u8a2d\u5b9a\u3059\u308b\u5909\u6570\u3067\u3059\u3002<\/strong>\uff08\u4ee5\u524d\u306f<code>$events<\/code>\u3067\u3057\u305f\u304c\u540d\u79f0\u5909\u66f4\u3055\u308c\u307e\u3057\u305f\uff09<br \/>\n<span style=\"font-size: 1rem;\">\u4f8b\u3048\u3070\u3001\u6ce8\u6587\u30c7\u30fc\u30bf\u304c\u767b\u9332\u3055\u308c\u305f\u3089\u53d7\u6ce8\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3059\u308b\u306a\u3069\u306e\u5834\u5408\u306b\u4f7f\u3048\u307e\u3059\u3002<\/span><\/p>\n<p>\u8a2d\u5b9a\u3067\u304d\u308b\u30a4\u30d9\u30f3\u30c8\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<li>retrieved\u3000\u30fb\u30fb\u30fb\u3000\u30c7\u30fc\u30bf\u304c\u53d6\u5f97\u3055\u308c\u305f\u3068\u304d<\/li>\n<li>creating\u3000\u30fb\u30fb\u30fb\u3000\u30c7\u30fc\u30bf\u3092\u65b0\u3057\u304f\u767b\u9332\u3059\u308b\u76f4\u524d<\/li>\n<li>created\u3000\u30fb\u30fb\u30fb\u3000\u30c7\u30fc\u30bf\u3092\u65b0\u3057\u304f\u767b\u9332\u3057\u305f\u76f4\u5f8c<\/li>\n<li>updating\u3000\u30fb\u30fb\u30fb\u3000\u30c7\u30fc\u30bf\u3092\u66f4\u65b0\u3059\u308b\u76f4\u524d<\/li>\n<li>updated\u3000\u30fb\u30fb\u30fb\u3000\u30c7\u30fc\u30bf\u3092\u66f4\u65b0\u3057\u305f\u76f4\u5f8c<\/li>\n<li>saving\u3000\u30fb\u30fb\u30fb\u3000\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3059\u308b\u76f4\u524d\uff08\u3064\u307e\u308a\u3001creating &amp; updating\uff09<\/li>\n<li>saved\u3000\u30fb\u30fb\u30fb\u3000\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3057\u305f\u76f4\u5f8c\uff08\u3064\u307e\u308a\u3001created &amp; updated\uff09<\/li>\n<li>deleting\u3000\u30fb\u30fb\u30fb\u3000\u30c7\u30fc\u30bf\u3092\u524a\u9664\u3059\u308b\u76f4\u524d<\/li>\n<li>deleted\u3000\u30fb\u30fb\u30fb\u3000\u30c7\u30fc\u30bf\u3092\u524a\u9664\u3057\u305f\u76f4\u5f8c<\/li>\n<li>restoring\u3000\u30fb\u30fb\u30fb\u3000\u30bd\u30d5\u30c8\u30c7\u30ea\u30fc\u30c8\u3092\u5143\u306b\u623b\u3059\u76f4\u524d<\/li>\n<li>restored\u3000\u30fb\u30fb\u30fb\u3000\u30bd\u30d5\u30c8\u30c7\u30ea\u30fc\u30c8\u3092\u5143\u306b\u623b\u3057\u305f\u76f4\u5f8c<\/li>\n<\/ul>\n<p>\u3067\u306f\u4eca\u56de\u306f\u5b9f\u969b\u306b<code>saved<\/code>\u30a4\u30d9\u30f3\u30c8\u3092\u4f5c\u3063\u3066\u307f\u307e\u3059\u3002<br \/>\n\u307e\u305a\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3067<code>ItemSaved<\/code>\u3068\u3044\u3046\u30a4\u30d9\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>php artisan make:event ItemSaved<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001<code>app\/Events\/ItemSaved.php<\/code>\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u3067\u304d\u3066\u3044\u308b\u306e\u3067\u3053\u308c\u3092\u958b\u3044\u3066\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306e\u5f15\u6570\u3092\u6b21\u306e\u3088\u3046\u306b\u3059\u308c\u3070\u8a72\u5f53\u3059\u308b<code>Item<\/code>\u30c7\u30fc\u30bf\u304c\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>public function __construct(<strong>Item $item<\/strong>)\r\n{\r\n    <strong>echo '\u4fdd\u5b58\u3055\u308c\u307e\u3057\u305f\uff01';<\/strong>\r\n}<\/pre>\n<p>\u7d9a\u3044\u3066\u3053\u306e\u30a4\u30d9\u30f3\u30c8\u3092<code>$dispatchesEvents<\/code>\u3078\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<pre>protected $dispatchesEvents = [\r\n    <strong>'saved' =&gt; \\App\\Events\\ItemSaved::class<\/strong>\r\n];<\/pre>\n<p>\u3053\u3046\u3059\u308b\u3053\u3068\u3067\u3001\u30c7\u30fc\u30bf\u304c\u4fdd\u5b58\u3055\u308c\u305f\u3068\u304d\u306b\u5148\u307b\u3069\u306e\u30b3\u30fc\u30c9\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2118\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/dispatches_events.png\" alt=\"\" width=\"129\" height=\"32\" \/><\/p>\n<h2>$timestamps \u3067\u65e5\u6642\u30c7\u30fc\u30bf\u3092\u8a2d\u5b9a\u3059\u308b<\/h2>\n<p><code>Laravel<\/code>\u306eDB\u30c6\u30fc\u30d6\u30eb\u306f\u521d\u671f\u72b6\u614b\u3067\u6b21\u306e\uff12\u3064\u306e\u65e5\u6642\u30c7\u30fc\u30bf\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>created_at\u3000\u30fb\u30fb\u30fb\u3000\u30c7\u30fc\u30bf\u304c\u4f5c\u6210\u3055\u308c\u305f\u65e5\u6642<\/li>\n<li>updated_at\u3000\u30fb\u30fb\u30fb\u3000\u30c7\u30fc\u30bf\u304c\u66f4\u65b0\u3055\u308c\u305f\u65e5\u6642<\/li>\n<\/ul>\n<p>\u305f\u3060\u3001\u3053\u306e\u65e5\u6642\u60c5\u5831\u306f\u4f8b\u3048\u3070\u90fd\u9053\u5e9c\u770c\u306e\u30de\u30b9\u30bf\u30fc\u30c7\u30fc\u30bf\u306a\u3069\u3067\u306f\u3042\u307e\u308a\u5fc5\u8981\u306a\u3044\u3053\u3068\u304c\u591a\u3044\u305f\u3081\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u7701\u7565\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u69cb\u9020\u306b\u3059\u308b\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2120\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/prefectures_table.png\" alt=\"\" width=\"178\" height=\"365\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/prefectures_table.png 178w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/prefectures_table-146x300.png 146w\" sizes=\"auto, (max-width: 178px) 100vw, 178px\" \/><\/p>\n<p>\u305d\u306e\u5834\u5408\u306b\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u30e2\u30c7\u30eb\u5185\u3067<code>$timestamps<\/code>\u3092\u6307\u5b9a\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>public $timestamps = false;<\/strong><\/pre>\n<p>\u3061\u306a\u307f\u306b\u3001\u3082\u3057\uff12\u3064\u306e\u65e5\u6642\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u7121\u3044\u306e\u306b\u30c7\u30fc\u30bf\u767b\u9332\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u6b21\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<pre>Column not found: 1054 Unknown column 'updated_at' in 'field list'<\/pre>\n<h2>$appends \u3067\u8ffd\u52a0\u30c7\u30fc\u30bf\u3092\u5e38\u306b\u547c\u3073\u51fa\u3059<\/h2>\n<p>\u4f8b\u3048\u3070\u3001DB\u30c6\u30fc\u30d6\u30eb\u306b<code>price<\/code>\u3068\u3044\u3046\u91d1\u984d\u304c\u5165\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u3042\u308a\u3001\u3053\u3053\u306b<code>10000<\/code>\u3068\u3044\u3046\u30c7\u30fc\u30bf\u304c\u5165\u3063\u3066\u3044\u305f\u3068\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2121\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/items_table.png\" alt=\"\" width=\"523\" height=\"75\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/items_table.png 523w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/items_table-300x43.png 300w\" sizes=\"auto, (max-width: 523px) 100vw, 523px\" \/><\/p>\n<p>\u3053\u306e\u5834\u5408\u3001\u91d1\u984d\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u308f\u3051\u3067\u3059\u304c\u3001<code>10000<\/code>\u3067\u306f\u306a\u304f\u3001<code>10,000\u5186<\/code>\u3068\u8868\u793a\u3057\u305f\u304f\u3042\u308a\u307e\u305b\u3093\u304b\uff1f\uff1f<\/p>\n<p>\u305d\u3093\u306a\u5834\u5408\u306f<code>accessor<\/code>\u3092\u4f5c\u3063\u3066\u304a\u304f\u3068\u3044\u3064\u3067\u3082\u52a0\u5de5\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\uff08\u8a73\u3057\u304f\u306f\u3001<a href=\"https:\/\/blog.capilano-fw.com\/?p=1241\">\u516815\u4ef6\uff01Laravel\u30fb\u4f7f\u3044\u56de\u3057\u3067\u304d\u308bAccessor\u5b9f\u4f8b<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\uff09\u3002\u305d\u3057\u3066\u3001\u3053\u306e<strong><code>accessor<\/code>\u3092\u5e38\u306b\u547c\u3073\u51fa\u3057\u305f\u3044\u5834\u5408\u306b<code>$appends<\/code>\u3092\u4f7f\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/strong><\/p>\n<p>\u3067\u306f\u5b9f\u969b\u306b\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre><strong>$item = \\App\\Item::first();<\/strong><\/pre>\n<p>\u307e\u305a\u306f\u3001<code>$appends<\/code>\u304c\u306a\u3044\u7121\u3044\u5834\u5408\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2124\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/items_table_2.png\" alt=\"\" width=\"248\" height=\"91\" \/><\/p>\n<p>\u3082\u3061\u308d\u3093\u3053\u306e\u4e2d\u306b\u306f\u901a\u5e38\u306e\u30c7\u30fc\u30bf\u3057\u304b\u5165\u3063\u3066\u304d\u307e\u305b\u3093\u3002<br \/>\n\u3067\u306f\u6b21\u306b<code>$item-&gt;yen_price<\/code>\u3068\u3057\u3066\u30c7\u30fc\u30bf\u53d6\u5f97\u3067\u304d\u308b<code>accessor<\/code>\u3092\u4f5c\u3063\u3066\u3001\u3053\u308c\u3092<code>$appends<\/code>\u306b\u767b\u9332\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong><code>\/app\/Item.php<\/code><\/strong><\/p>\n<pre><strong>protected $appends = [<\/strong>\r\n<strong>    'yen_price'<\/strong>\r\n<strong>];<\/strong>\r\n\r\n<strong>public function getYenPriceAttribute() {<\/strong>\r\n\r\n<strong>    return number_format($this-&gt;price) .'\u5186';<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306b<strong>\u3044\u3064\u3067\u3082<code>yen_price<\/code>\u304c\u5165\u3063\u3066\u304f\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2126\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/items_table_3.png\" alt=\"\" width=\"250\" height=\"104\" \/><\/p>\n<p>\u305d\u306e\u305f\u3081\u3001<code>Ajax<\/code>\u3067\u30c7\u30fc\u30bf\u3092\u8fd4\u3059\u5834\u5408\u306a\u3069\u306b\u91cd\u5b9d\u3059\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<h2>$dateFormat \u3067\u65e5\u4ed8\u30c7\u30fc\u30bf\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u6307\u5b9a\u3059\u308b<\/h2>\n<p>\u521d\u671f\u72b6\u614b\u3067<code>created_at<\/code>\u3084<code>updated_at<\/code>\u306e\u65e5\u6642\u30d5\u30a3\u30fc\u30eb\u30c9\u306f\u3001<code>2000-01-01 00:00:00<\/code>\u3068\u3044\u3046<code>Y-m-d H:i:s<\/code>\u306e\u5f62\u5f0f\u3067\u30c7\u30fc\u30bf\u4fdd\u5b58\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3001\u3082\u3057\u304b\u3059\u308b\u3068<strong>Unix\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u3082\u3042\u308b\u3067\u3057\u3087\u3046\u3002<\/strong><br \/>\n\u305d\u3093\u306a\u5834\u5408\u306f<code>$dateFormat<\/code>\u304c\u4f7f\u3048\u307e\u3059\u3002<\/p>\n<pre><strong>protected $dateFormat = 'U';<\/strong><\/pre>\n<p>\u306a\u304a\u3001\u3053\u306e\u5834\u5408\u30d5\u30a3\u30fc\u30eb\u30c9\u306f\u6570\u5024\u578b\u3067\u306a\u3044\u3068\u3044\u3051\u307e\u305b\u3093\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5909\u66f4\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre>Schema::create('items', function (Blueprint $table) {\r\n    $table-&gt;increments('id');\r\n    $table-&gt;string('name');\r\n    <strong>\/\/ $table-&gt;timestamps();<\/strong>\r\n<strong>    $table-&gt;integer('created_at');<\/strong>\r\n<strong>    $table-&gt;integer('updated_at');<\/strong>\r\n});<\/pre>\n<p>\u5b9f\u969b\u306b\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3057\u305f\u3082\u306e\u304c\u3053\u3061\u3089\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2128\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/items_table_4.png\" alt=\"\" width=\"428\" height=\"74\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/items_table_4.png 428w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/items_table_4-300x52.png 300w\" sizes=\"auto, (max-width: 428px) 100vw, 428px\" \/><\/p>\n<h2>$dates \u3067\u65e5\u6642\u30c7\u30fc\u30bf\u3092Carbon\u30a4\u30f3\u30bf\u30f3\u30b9\u3078\u81ea\u52d5\u5909\u63db\u3059\u308b<\/h2>\n<p>\u521d\u671f\u72b6\u614b\u3067\u3001<code>created_at<\/code>\u3068<code>updated_at<\/code>\u306e\u30c7\u30fc\u30bf\u306f\u81ea\u52d5\u7684\u306b\u65e5\u4ed8\u30d1\u30c3\u30b1\u30fc\u30b8<code>Carbon<\/code>\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u53d6\u5f97\u3067\u304d\u307e\u3059\u304c\u3001\u3082\u3057\u4ed6\u306b\u3082<code>Carbon<\/code>\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3057\u305f\u3044\u5834\u5408\u306f<code>$dates<\/code>\u3092\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3067\u306f\u5b9f\u969b\u306e\u4f8b\u3067\u3059\u3002<br \/>\n\u3082\u3057\u6b21\u306e\u3088\u3046\u306b\u8ca9\u58f2\u3092\u958b\u59cb\u3057\u305f\u65e5\u6642<code>released_at<\/code>\u3068\u3044\u3046\u30c7\u30fc\u30bf\u304c\u3042\u308b\u3068\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2130\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/items_table_5.png\" alt=\"\" width=\"650\" height=\"72\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/items_table_5.png 650w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/items_table_5-300x33.png 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/p>\n<p>\u305d\u3057\u3066\u3001\u3053\u306e\u8ca9\u58f2\u958b\u59cb\u65e5\u6642\u3092Carbon\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3059\u308b\u306b\u306f\u3053\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>protected $dates<\/strong> = [\r\n    'created_at',\r\n    'updated_at',\r\n    <strong>'released_at'<\/strong> \/\/ \ud83d\udc48 \u3053\u3053\r\n];<\/pre>\n<p>\u3059\u308b\u3068\u3001\u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf\u306f<code>Carbon<\/code>\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$item = \\App\\Item::first();\r\n<strong>$released_at = $item-&gt;released_at; \/\/ Carbon\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9<\/strong><\/pre>\n<h2 id=\"hidden\">$hidden \u3067\u30c7\u30fc\u30bf\u53d6\u5f97\u3057\u306a\u3044\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6307\u5b9a\u3059\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u300c\u58f2\u5024\uff08price\uff09\u300d\u3068\u300c\u4ed5\u5165\u308c\u5024\uff08cost_price\uff09\u300d\u304c\u3042\u308a\u3001<strong>\u4ed5\u5165\u308c\u5024\u306f\u793e\u5916\u79d8\u3067\u3001\u7d76\u5bfe\u306b\u5916\u306b\u51fa\u3059\u3079\u304d\u3067\u306f\u306a\u3044\u30c7\u30fc\u30bf\u3060\u3068\u3057\u307e\u3059\u3002<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2131\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/items_table_6.png\" alt=\"\" width=\"601\" height=\"71\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/items_table_6.png 601w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/items_table_6-300x35.png 300w\" sizes=\"auto, (max-width: 601px) 100vw, 601px\" \/><\/p>\n<p>\u3053\u306e\u5834\u5408\u3001\u3082\u3061\u308d\u3093\u4ed5\u5165\u308c\u5024\u3092\u8868\u793a\u3057\u306a\u3044\u3088\u3046\u6ce8\u610f\u3057\u3066\u3044\u308c\u3070\u3044\u3044\u308f\u3051\u3067\u3059\u304c\u3001\u3084\u306f\u308a\u4eba\u9593\u3067\u3059\u304b\u3089\u3053\u306e\u4f5c\u696d\u3092\u5fd8\u308c\u3066\u3057\u307e\u3046\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u305d\u3093\u306a\u5834\u5408\u306f<code>$hidden<\/code>\u3092\u6307\u5b9a\u3057\u3066\u304a\u3044\u3066\u3001\u524d\u3082\u3063\u3066\u30c7\u30fc\u30bf\u53d6\u5f97\u3092\u3057\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u304a\u3051\u3070\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>protected $hidden = [<\/strong>\r\n<strong>    'cost_price'<\/strong>\r\n<strong>];<\/strong><\/pre>\n<p>\u5b9f\u969b\u306b\u5b9f\u884c\u3057\u305f\u7d50\u679c\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002\uff08cost_price\u306f\u5b58\u5728\u3057\u3066\u3044\u307e\u305b\u3093\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2132\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/items_table_7.png\" alt=\"\" width=\"250\" height=\"92\" \/><\/p>\n<h2 id=\"visible\">$visible \u3067\u30c7\u30fc\u30bf\u53d6\u5f97\u3059\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6307\u5b9a\u3059\u308b<\/h2>\n<p><a href=\"#hidden\">$hidden<\/a>\u3068\u306f\u9006\u306b\u3001\u30c7\u30fc\u30bf\u53d6\u5f97\u3059\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n\u6b21\u306e\u4f8b\u3067\u306f\u6307\u5b9a\u3057\u305f\uff13\u3064\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3057\u304b\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u307e\u305b\u3093\u3002<\/p>\n<pre><strong>protected $visible = [<\/strong>\r\n<strong>    'id',<\/strong>\r\n<strong>    'name',<\/strong>\r\n<strong>    'price'<\/strong>\r\n<strong>];<\/strong><\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2133\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/items_table_8.png\" alt=\"\" width=\"182\" height=\"67\" \/><\/p>\n<h2>$perPage \u3067paginate()\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u4ef6\u6570\u3092\u5909\u66f4\u3059\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30da\u30fc\u30b8\u51e6\u7406\u304c\u3067\u304d\u308b\u30c7\u30fc\u30bf\u53d6\u5f97\u3092\u3059\u308b\u5834\u5408\u3067\u3059\u3002\uff08\u5f15\u6570\u306f\u7a7a\uff09<\/p>\n<pre><strong>$item = \\App\\Item::paginate();<\/strong><\/pre>\n<p>\u521d\u671f\u72b6\u614b\u3067\u306f<code>15\u4ef6<\/code>\u305a\u3064\u30c7\u30fc\u30bf\u53d6\u5f97\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001<code>$perPage<\/code>\u3092\u6307\u5b9a\u3059\u308b\u3068\u3053\u306e\u4ef6\u6570\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><strong>protected $perPage = 5;<\/strong><\/pre>\n<p>\u203b \u306a\u304a\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4ef6\u6570\u3092\u76f4\u63a5\u6307\u5b9a\u3059\u308b\u3068\u305d\u3061\u3089\u304c\u512a\u5148\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre>$item = \\App\\Item::paginate(<strong>50<\/strong>);<\/pre>\n<h2>$table \u3067\u30c6\u30fc\u30d6\u30eb\u540d\u3092\u6307\u5b9a\u3059\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u30e2\u30c7\u30eb\u540d\u304c<code>Item<\/code>\u3068\u3044\u3046\u540d\u524d\u306e\u5834\u5408\u3001\u521d\u671f\u72b6\u614b\u3067\u306f<code>items<\/code>\u3068\u3044\u3046DB\u30c6\u30fc\u30d6\u30eb\u304c\u53c2\u7167\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3001\u3082\u3057\u304b\u3059\u308b\u3068\u904e\u53bb\u306b\u4f5c\u3089\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u3092\u53c2\u7167\u3057\u305f\u3044\u5834\u5408\u3084\u3001\u3082\u3057\u304f\u306f\u5225\u30b7\u30b9\u30c6\u30e0\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u53c2\u7167\u3059\u308b\u5834\u5408\u3082\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u305d\u306e\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b<code>$table<\/code>\u3092\u6307\u5b9a\u3059\u308b\u3068\u81ea\u52d5\u3067\u305d\u3061\u3089\u3092\u53c2\u7167\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>protected $table = 'old_items';<\/strong><\/pre>\n<h2>$touches \u3067\u89aa\u30c6\u30fc\u30d6\u30eb\u306e\u66f4\u65b0\u65e5\u6642\u3092\u81ea\u52d5\u66f4\u65b0\u3059\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u30d6\u30ed\u30b0\u8a18\u4e8b\u3092\u4fdd\u5b58\u3059\u308b<code>Post<\/code>\u3068\u3044\u3046\u30e2\u30c7\u30eb\u304c\u3042\u308a\u3001\u5404\u8a18\u4e8b\u306b\u5bfe\u3059\u308b\u30b3\u30e1\u30f3\u30c8\u306f<code>PostComment<\/code>\u30e2\u30c7\u30eb\u304c\u62c5\u5f53\u3057\u3066\u3044\u308b\u3068\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u3082\u3057\u304b\u3059\u308b\u3068\u30b3\u30e1\u30f3\u30c8\u304c\u4fdd\u5b58\u3055\u308c\u305f\u3089\u3001\u89aa\u30c6\u30fc\u30d6\u30eb\u306e\u8a18\u4e8b\u30c7\u30fc\u30bf\u3082\u66f4\u65b0\u65e5\u6642\uff08<code>updated_at<\/code>\uff09\u3092\u65b0\u3057\u304f\u3057\u305f\u3044\u5834\u5408\u3082\u3042\u308b\u3067\u3057\u3087\u3046\u3002<br \/>\n\u4f8b\u3048\u3070\u3001\u8a18\u4e8b\u306e\u300c\u6700\u7d42\u66f4\u65b0\u65e5\u6642\u300d\u3092\u8868\u793a\u3057\u305f\u3044\u5834\u5408\u306a\u3069\u3067\u3059\u306d\u3002<\/p>\n<p>\u3053\u306e\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b<code>$touches<\/code>\u3078\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u3092\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<pre>class <strong>PostComment<\/strong> extends Model\r\n{\r\n    <strong>protected $touches = ['post'];<\/strong>\r\n\r\n    public function <strong>post<\/strong>()\r\n    {\r\n        return $this-&gt;belongsTo('App\\Post');\r\n    }<\/pre>\n<h2>$primaryKey \u3067\u30d7\u30e9\u30a4\u30de\u30ea\u30fc\u30ad\u30fc\u3092\u5909\u66f4\u3059\u308b<\/h2>\n<pre><strong>protected $primaryKey = 'product_id';<\/strong><\/pre>\n<h2>$incrementing \u3067\u30aa\u30fc\u30c8\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30c8\u3092\u3057\u306a\u3044\u3088\u3046\u306b\u3059\u308b<\/h2>\n<pre><strong>public $incrementing = false;<\/strong><\/pre>\n<h2>$keyType \u3067\u30d7\u30e9\u30a4\u30de\u30ea\u30fc\u30ad\u30fc\u306e\u578b\u3092\u6307\u5b9a\u3059\u308b<\/h2>\n<pre><strong>protected $keyType = 'string';<\/strong><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001Laravel\u306e\u30e2\u30c7\u30eb\uff08Eloquent\uff09\u3068\u3044\u3048\u3070\u958b\u767a\u8005\u304c\u559c\u3076\u300c\u304b\u3086\u3044\u3068\u3053\u308d\u306b\u624b\u304c\u5c4a\u304f\u300d\u6a5f\u80fd\u304c\u305f\u304f\u3055\u3093\u3064\u3044\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u4eca\u56de\u306f\u305d\u306e\u4e2d\u3067\u3082\u300c\u30e1\u30f3\u30d0\u5909\u6570 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=2114\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u516816\u5b9f\u4f8b\uff01Laravel\u306e\u30e2\u30c7\u30eb\u3067\u4f7f\u3048\u308b\u30e1\u30f3\u30d0\u5909\u6570&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":2135,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[105],"class_list":["post-2114","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","tag-eloquent"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2114","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=2114"}],"version-history":[{"count":17,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2114\/revisions"}],"predecessor-version":[{"id":7139,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2114\/revisions\/7139"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/2135"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}