{"id":1241,"date":"2018-09-19T04:59:38","date_gmt":"2018-09-18T19:59:38","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=1241"},"modified":"2018-10-23T03:37:33","modified_gmt":"2018-10-22T18:37:33","slug":"%e5%85%a815%e4%bb%b6%ef%bc%81laravel%e3%83%bb%e4%bd%bf%e3%81%84%e5%9b%9e%e3%81%97%e3%81%a7%e3%81%8d%e3%82%8baccessor%e5%ae%9f%e4%be%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=1241","title":{"rendered":"\u516815\u4ef6\uff01Laravel\u30fb\u4f7f\u3044\u56de\u3057\u3067\u304d\u308bAccessor\u5b9f\u4f8b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001Laravel <code>5.7<\/code>\u00a0\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u305f\u95a2\u4fc2\u3067\u3001\u6700\u8fd1\u306f\u4e3b\u306b\u65b0\u3057\u3044\u6a5f\u80fd\u306b\u3064\u3044\u3066\u306e\u8a18\u4e8b\u3092\u516c\u958b\u3057\u3066\u304d\u307e\u3057\u305f\u304c\u3001\u3053\u306e\u8fba\u3067Laravel\u306e\u57fa\u672c\u7684\u306a\u6a5f\u80fd\u306b\u3064\u3044\u3066\u3082\u6df1\u304f\u6398\u308a\u4e0b\u3052\u3066\u307f\u305f\u304f\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u4eca\u56de\u306e\u57fa\u672c\u7684\u306a\u6a5f\u80fd\u306f\u3001<code>Accessor\uff08\u30a2\u30af\u30bb\u30c3\u30b5\u30fc\uff09<\/code>\u3067\u3059\u3002<\/p>\n<p>Accessor\u3068\u306f\u3001DB\u304b\u3089\u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf\u3092\u81ea\u52d5\u7684\u306b\u52a0\u5de5\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b<code>user_code<\/code>\u306a\u3069\u3068\u3057\u3066\u3001\u30bc\u30ed\u3067\u57cb\u3081\u3089\u308c\u305f\u30b3\u30fc\u30c9\u3092\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u5834\u5408\u3067\u3059\u306d\u3002<\/p>\n<pre><strong>$user = \\App\\User::find(1);\r\n\r\n$user-&gt;user_code; \/\/ \u4f8b\uff1a 0001<\/strong><\/pre>\n<p>\u3053\u308c\u306e\u4f55\u304c\u3044\u3044\u304b\u3068\u8a00\u3046\u3068\u3001\u4e00\u5ea6Accessor\u3092\u4f5c\u3063\u3066\u304a\u304f\u3068\u3001\u5f8c\u3067\u3044\u3061\u3044\u3061\u30c7\u30fc\u30bf\u52a0\u5de5\u3059\u308b\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u306a\u304f\u3001\u81ea\u52d5\u7684\u306b\u8abf\u6574\u3055\u308c\u305f\u6b63\u3057\u3044\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u305d\u3093\u306aAccessor\u306e\u4fbf\u5229\u306a\u5b9f\u4f8b\u3092\u30b1\u30fc\u30b9\u5225\u3067\u307e\u3068\u3081\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<span style=\"font-size: 1rem;\">\u305c\u3072\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-428 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/30.png\" alt=\"\" width=\"205\" height=\"350\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/30.png 205w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/30-176x300.png 176w\" sizes=\"auto, (max-width: 205px) 100vw, 205px\" \/><\/p>\n<h1>Accessor\u3092\u8a2d\u5b9a\u3059\u308b\u306b\u306f<\/h1>\n<p>\u307e\u305a\u306fAccessor\u3092\u8a2d\u5b9a\u3059\u308b\u57fa\u672c\u7684\u306a\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<p>Accessor\u3092\u8a2d\u5b9a\u3059\u308b\u306b\u306f\u3001\u30e2\u30c7\u30eb\u306e\u4e2d\u306b<code>get***Attribute()<\/code>\u3068\u3044\u3046\u30e1\u30bd\u30c3\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3060\u3051\u3067OK\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001<code>getUserCodeAttribute()<\/code>\u306a\u3069\u3067\u3059\u306d\u3002<br \/>\n\u3064\u307e\u308a\u3001Accessor\u306f\u3001<\/p>\n<ul>\n<li>\u30e1\u30bd\u30c3\u30c9\u540d\u304cget\u3067\u59cb\u307e\u308b<\/li>\n<li>\u30e1\u30bd\u30c3\u30c9\u540d\u304cAttribute\u3067\u7d42\u308f\u308b<\/li>\n<\/ul>\n<p>\u3068\u3044\u3046\u30eb\u30fc\u30eb\u306b\u5f93\u3063\u3066\u4f5c\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n<span style=\"font-size: 1rem;\">\u305d\u3057\u3066\u3001\u5b9f\u969b\u306b\u30c7\u30fc\u30bf\u53d6\u5f97\u3059\u308b\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b<code>get<\/code>\u3068<code>Attribute<\/code>\u3092\u629c\u304b\u3057\u305f\u540d\u524d\u3067\u547c\u3073\u51fa\u305b\u3070OK\u3067\u3059\u3002<\/span><\/p>\n<pre><strong>$user-&gt;user_code;<\/strong> \/\/ \u4f8b\uff1a 0001\r\n\r\n\/\/ \u3082\u3057\u304f\u306f\r\n\r\n<strong>$user-&gt;userCode;<\/strong><\/pre>\n<p>\u3067\u306f\u3001\u6b21\u304b\u3089\u306f\u3053\u306eAccessor\u3092\u4f7f\u3063\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u30b3\u30fc\u30c9\u3092\u7d39\u4ecb\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<ul>\n<li>\u90fd\u9053\u5e9c\u770cID\u304b\u3089\u90fd\u9053\u5e9c\u770c\u540d<\/li>\n<li>\u540d\u5b57\u3068\u540d\u524d\u3092\u7d50\u5408\u3057\u305f\u30d5\u30eb\u30cd\u30fc\u30e0<\/li>\n<li>\u897f\u66a6\u304b\u3089\u548c\u66a6\u3078\u306e\u5909\u63db<\/li>\n<\/ul>\n<h1>\u3088\u304f\u4f7f\u3046Accessor\u5b9f\u4f8b<\/h1>\n<h2>\u90fd\u9053\u5e9c\u770cID\u304b\u3089\u90fd\u9053\u5e9c\u770c\u540d\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u691c\u7d22\u304c\u9ad8\u901f\u306b\u306a\u308b\u306a\u3069\u306e\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308b\u305f\u3081\u3001\u958b\u767a\u3067\u306f\u3088\u304f\u90fd\u9053\u5e9c\u770c\u540d\u3067\u306f\u306a\u304fJIS\u898f\u683c\u306e\u90fd\u9053\u5e9c\u770cID\u3092\u4f7f\u3046\u30b1\u30fc\u30b9\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3044\u3061\u3044\u3061\u90fd\u9053\u5e9c\u770c\u540d\u304c\u5165\u3063\u305f\u9023\u60f3\u914d\u5217\u304b\u3089\u8a72\u5f53\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u306e\u306f\u9762\u5012\u3067\u3059\u3002<\/p>\n<p>\u305d\u3093\u306a\u3068\u304d\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306aAccessor\u3092\u4f7f\u3063\u3066\u81ea\u52d5\u5316\u3059\u308b\u3068\u3044\u3044\u3067\u3057\u3087\u3046\u3002\uff08\u90fd\u9053\u5e9c\u770cID\u304c<code>prefecture_id<\/code>\u3068\u3044\u3046\u30d5\u30a3\u30fc\u30eb\u30c9\u540d\u306e\u5834\u5408\uff09<\/p>\n<pre><strong>public function getPrefectureNameAttribute() {<\/strong>\r\n\r\n<strong>    $prefs = [<\/strong>\r\n<strong>        '1' =&gt; '\u5317\u6d77\u9053',<\/strong>\r\n<strong>        '2' =&gt; '\u9752\u68ee\u770c',<\/strong>\r\n<strong>        '3' =&gt; '\u5ca9\u624b\u770c',<\/strong>\r\n<strong>        '4' =&gt; '\u5bae\u57ce\u770c',<\/strong>\r\n<strong>        '5' =&gt; '\u79cb\u7530\u770c',<\/strong>\r\n<strong>        '6' =&gt; '\u5c71\u5f62\u770c',<\/strong>\r\n<strong>        '7' =&gt; '\u798f\u5cf6\u770c',<\/strong>\r\n<strong>        '8' =&gt; '\u8328\u57ce\u770c',<\/strong>\r\n<strong>        '9' =&gt; '\u6803\u6728\u770c',<\/strong>\r\n<strong>        '10' =&gt; '\u7fa4\u99ac\u770c',<\/strong>\r\n<strong>        '11' =&gt; '\u57fc\u7389\u770c',<\/strong>\r\n<strong>        '12' =&gt; '\u5343\u8449\u770c',<\/strong>\r\n<strong>        '13' =&gt; '\u6771\u4eac\u90fd',<\/strong>\r\n<strong>        '14' =&gt; '\u795e\u5948\u5ddd\u770c',<\/strong>\r\n<strong>        '15' =&gt; '\u65b0\u6f5f\u770c',<\/strong>\r\n<strong>        '16' =&gt; '\u5bcc\u5c71\u770c',<\/strong>\r\n<strong>        '17' =&gt; '\u77f3\u5ddd\u770c',<\/strong>\r\n<strong>        '18' =&gt; '\u798f\u4e95\u770c',<\/strong>\r\n<strong>        '19' =&gt; '\u5c71\u68a8\u770c',<\/strong>\r\n<strong>        '20' =&gt; '\u9577\u91ce\u770c',<\/strong>\r\n<strong>        '21' =&gt; '\u5c90\u961c\u770c',<\/strong>\r\n<strong>        '22' =&gt; '\u9759\u5ca1\u770c',<\/strong>\r\n<strong>        '23' =&gt; '\u611b\u77e5\u770c',<\/strong>\r\n<strong>        '24' =&gt; '\u4e09\u91cd\u770c',<\/strong>\r\n<strong>        '25' =&gt; '\u6ecb\u8cc0\u770c',<\/strong>\r\n<strong>        '26' =&gt; '\u4eac\u90fd\u5e9c',<\/strong>\r\n<strong>        '27' =&gt; '\u5927\u962a\u5e9c',<\/strong>\r\n<strong>        '28' =&gt; '\u5175\u5eab\u770c',<\/strong>\r\n<strong>        '29' =&gt; '\u5948\u826f\u770c',<\/strong>\r\n<strong>        '30' =&gt; '\u548c\u6b4c\u5c71\u770c',<\/strong>\r\n<strong>        '31' =&gt; '\u9ce5\u53d6\u770c',<\/strong>\r\n<strong>        '32' =&gt; '\u5cf6\u6839\u770c',<\/strong>\r\n<strong>        '33' =&gt; '\u5ca1\u5c71\u770c',<\/strong>\r\n<strong>        '34' =&gt; '\u5e83\u5cf6\u770c',<\/strong>\r\n<strong>        '35' =&gt; '\u5c71\u53e3\u770c',<\/strong>\r\n<strong>        '36' =&gt; '\u5fb3\u5cf6\u770c',<\/strong>\r\n<strong>        '37' =&gt; '\u9999\u5ddd\u770c',<\/strong>\r\n<strong>        '38' =&gt; '\u611b\u5a9b\u770c',<\/strong>\r\n<strong>        '39' =&gt; '\u9ad8\u77e5\u770c',<\/strong>\r\n<strong>        '40' =&gt; '\u798f\u5ca1\u770c',<\/strong>\r\n<strong>        '41' =&gt; '\u4f50\u8cc0\u770c',<\/strong>\r\n<strong>        '42' =&gt; '\u9577\u5d0e\u770c',<\/strong>\r\n<strong>        '43' =&gt; '\u718a\u672c\u770c',<\/strong>\r\n<strong>        '44' =&gt; '\u5927\u5206\u770c',<\/strong>\r\n<strong>        '45' =&gt; '\u5bae\u5d0e\u770c',<\/strong>\r\n<strong>        '46' =&gt; '\u9e7f\u5150\u5cf6\u770c',<\/strong>\r\n<strong>        '47' =&gt; '\u6c96\u7e04\u770c'<\/strong>\r\n<strong>    ];<\/strong>\r\n<strong>    return array_get($prefs, $this-&gt;prefecture_id);<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<p>\u90fd\u9053\u5e9c\u770cID\u304c<code>13<\/code>\u306e\u30c7\u30fc\u30bf\u3067\u5b9f\u884c\u3059\u308b\u3068\u300c\u6771\u4eac\u90fd\u300d\u304c\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><strong>$user-&gt;prefecture_name;<\/strong> \/\/ \u6771\u4eac\u90fd<\/pre>\n<p>\u307e\u305f\u3001\u9006\u306b\u540d\u524d\u304b\u3089\u90fd\u9053\u5e9c\u770cID\u3092\u53d6\u5f97\u3059\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\uff08\u90fd\u9053\u5e9c\u770c\u540d\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u540d\u304c<code>prefecture<\/code>\u306e\u5834\u5408\uff09<\/p>\n<pre><strong>public function getPrefectureIdAttribute() {<\/strong>\r\n\r\n<strong>    $prefs = [<\/strong>\r\n<strong>        '1' =&gt; '\u5317\u6d77\u9053',<\/strong>\r\n<strong>        '2' =&gt; '\u9752\u68ee\u770c',<\/strong>\r\n<strong>        '3' =&gt; '\u5ca9\u624b\u770c',<\/strong>\r\n<strong>        '4' =&gt; '\u5bae\u57ce\u770c',<\/strong>\r\n<strong>        '5' =&gt; '\u79cb\u7530\u770c',<\/strong>\r\n<strong>        '6' =&gt; '\u5c71\u5f62\u770c',<\/strong>\r\n<strong>        '7' =&gt; '\u798f\u5cf6\u770c',<\/strong>\r\n<strong>        '8' =&gt; '\u8328\u57ce\u770c',<\/strong>\r\n<strong>        '9' =&gt; '\u6803\u6728\u770c',<\/strong>\r\n<strong>        '10' =&gt; '\u7fa4\u99ac\u770c',<\/strong>\r\n<strong>        '11' =&gt; '\u57fc\u7389\u770c',<\/strong>\r\n<strong>        '12' =&gt; '\u5343\u8449\u770c',<\/strong>\r\n<strong>        '13' =&gt; '\u6771\u4eac\u90fd',<\/strong>\r\n<strong>        '14' =&gt; '\u795e\u5948\u5ddd\u770c',<\/strong>\r\n<strong>        '15' =&gt; '\u65b0\u6f5f\u770c',<\/strong>\r\n<strong>        '16' =&gt; '\u5bcc\u5c71\u770c',<\/strong>\r\n<strong>        '17' =&gt; '\u77f3\u5ddd\u770c',<\/strong>\r\n<strong>        '18' =&gt; '\u798f\u4e95\u770c',<\/strong>\r\n<strong>        '19' =&gt; '\u5c71\u68a8\u770c',<\/strong>\r\n<strong>        '20' =&gt; '\u9577\u91ce\u770c',<\/strong>\r\n<strong>        '21' =&gt; '\u5c90\u961c\u770c',<\/strong>\r\n<strong>        '22' =&gt; '\u9759\u5ca1\u770c',<\/strong>\r\n<strong>        '23' =&gt; '\u611b\u77e5\u770c',<\/strong>\r\n<strong>        '24' =&gt; '\u4e09\u91cd\u770c',<\/strong>\r\n<strong>        '25' =&gt; '\u6ecb\u8cc0\u770c',<\/strong>\r\n<strong>        '26' =&gt; '\u4eac\u90fd\u5e9c',<\/strong>\r\n<strong>        '27' =&gt; '\u5927\u962a\u5e9c',<\/strong>\r\n<strong>        '28' =&gt; '\u5175\u5eab\u770c',<\/strong>\r\n<strong>        '29' =&gt; '\u5948\u826f\u770c',<\/strong>\r\n<strong>        '30' =&gt; '\u548c\u6b4c\u5c71\u770c',<\/strong>\r\n<strong>        '31' =&gt; '\u9ce5\u53d6\u770c',<\/strong>\r\n<strong>        '32' =&gt; '\u5cf6\u6839\u770c',<\/strong>\r\n<strong>        '33' =&gt; '\u5ca1\u5c71\u770c',<\/strong>\r\n<strong>        '34' =&gt; '\u5e83\u5cf6\u770c',<\/strong>\r\n<strong>        '35' =&gt; '\u5c71\u53e3\u770c',<\/strong>\r\n<strong>        '36' =&gt; '\u5fb3\u5cf6\u770c',<\/strong>\r\n<strong>        '37' =&gt; '\u9999\u5ddd\u770c',<\/strong>\r\n<strong>        '38' =&gt; '\u611b\u5a9b\u770c',<\/strong>\r\n<strong>        '39' =&gt; '\u9ad8\u77e5\u770c',<\/strong>\r\n<strong>        '40' =&gt; '\u798f\u5ca1\u770c',<\/strong>\r\n<strong>        '41' =&gt; '\u4f50\u8cc0\u770c',<\/strong>\r\n<strong>        '42' =&gt; '\u9577\u5d0e\u770c',<\/strong>\r\n<strong>        '43' =&gt; '\u718a\u672c\u770c',<\/strong>\r\n<strong>        '44' =&gt; '\u5927\u5206\u770c',<\/strong>\r\n<strong>        '45' =&gt; '\u5bae\u5d0e\u770c',<\/strong>\r\n<strong>        '46' =&gt; '\u9e7f\u5150\u5cf6\u770c',<\/strong>\r\n<strong>        '47' =&gt; '\u6c96\u7e04\u770c'<\/strong>\r\n<strong>    ];<\/strong>\r\n<strong>    return array_search($this-&gt;prefecture, $prefs);<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<pre><strong>$user-&gt;prefecture_id;<\/strong> \/\/ 13<\/pre>\n<h2>\u540d\u5b57\u3068\u540d\u524d\u3092\u7d50\u5408\u3057\u305f\u30d5\u30eb\u30cd\u30fc\u30e0\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u4f1a\u54e1\u30c7\u30fc\u30bf\u3092\u7ba1\u7406\u3059\u308b\u5834\u5408\u3001\u300c\u540d\u5b57\u300d\u3068\u300c\u540d\u524d\u300d\u3092\u5206\u3051\u3066\u30c7\u30fc\u30bf\u4fdd\u5b58\u3057\u3066\u304a\u304f\u5834\u5408\u3082\u591a\u3044\u3067\u3057\u3087\u3046\u3002\u4f8b\u3048\u3070\u3001<code>first_name<\/code>\u3068<code>last_name<\/code>\u306e\u3088\u3046\u306a\u30d5\u30a3\u30fc\u30eb\u30c9\u540d\u3067\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u3053\u306e\uff12\u3064\u306e\u30c7\u30fc\u30bf\u3092\u7d50\u5408\u3057\u3066<code>full_name<\/code>\u3068\u3057\u3066\u30d5\u30eb\u30cd\u30fc\u30e0\u304c\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>public function getFullNameAttribute() {\r\n\r\n    <strong>return $this-&gt;first_name .' '. $this-&gt;last_name;<\/strong>\r\n\r\n}<\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>$user-&gt;full_name;<\/strong> \/\/ \u5c71\u7530 \u592a\u90ce<\/pre>\n<h2>\u5e74\u9f62\u306b\u300c\u6b73\u300d\u3092\u8ffd\u52a0\u3059\u308b<\/h2>\n<p>\u4f1a\u54e1\u30c7\u30fc\u30bf\u306e\u5e74\u9f62\u306f\u901a\u5e38\u6570\u5024\u3068\u3057\u3066\u4fdd\u5b58\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u8868\u793a\u3059\u308b\u5834\u5408\u306f\u300c20\u6b73\u300d\u3068\u5358\u4f4d\u3092\u3064\u3051\u308b\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002\u305d\u3093\u306a\u5834\u5408\u3082\u300c\u6b73\u300d\u3092\u81ea\u52d5\u7684\u306b\u4ed8\u52a0\u3059\u308bAccessor\u3092\u4f5c\u6210\u3057\u3066\u304a\u304f\u3068\u4fbf\u5229\u3067\u3059\u3002<\/p>\n<pre><strong>public function getUnitAgeAttribute() {<\/strong>\r\n\r\n<strong>    return $this-&gt;age .'\u6b73';<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<pre><strong>$user-&gt;unit_age;<\/strong> \/\/ 20\u6b73<\/pre>\n<h2>\u8840\u6db2\u578b\u306b\u300c\u578b\u300d\u3092\u4ed8\u52a0\u3059\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u4f1a\u54e1\u30c7\u30fc\u30bf\u306b\u8840\u6db2\u578b\u3092\u4fdd\u5b58\u3059\u308b\u5834\u5408\u3001\u300cA\u300d\u300cB\u300d\u306a\u3069\u3068\u3057\u3066\u4fdd\u5b58\u3053\u3068\u304c\u3042\u308b\u3067\u3057\u3087\u3046\u3002\u305d\u3057\u3066\u3001\u305d\u3046\u3044\u3063\u305f\u30c7\u30fc\u30bf\u306b\u300cA\u578b\u300d\u3068\u5358\u4f4d\u3082\u8ffd\u52a0\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>public function getUnitBloodTypeAttribute() {<\/strong>\r\n\r\n<strong>    return $this-&gt;blood_type .'\u578b';<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<pre><strong>$user-&gt;unit_blood_type;<\/strong> \/\/ A\u578b<\/pre>\n<h2>\u9577\u3055\u30c7\u30fc\u30bf\u306b\u300ccm\u300d\u3092\u3064\u3051\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u4f1a\u54e1\u30c7\u30fc\u30bf\u306e\u8eab\u9577\u306b\u300ccm\u300d\u5358\u4f4d\u3092\u4ed8\u52a0\u3057\u305f\u3044\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre><strong>public function getUnitHeightAttribute() {<\/strong>\r\n\r\n<strong>    return $this-&gt;height .'cm';<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<pre><strong>$user-&gt;unit_height;<\/strong> \/\/ 168cm<\/pre>\n<h2>\u91cd\u3055\u306e\u30c7\u30fc\u30bf\u306b\u300ckg\u300d\u3092\u3064\u3051\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u4f1a\u54e1\u306e\u4f53\u91cd\u306b\u300ckg\u300d\u5358\u4f4d\u3092\u4ed8\u52a0\u3057\u305f\u3044\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre><strong>public function getUnitWeightAttribute() {<\/strong>\r\n\r\n<strong>    return $this-&gt;weight .'kg';<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<pre><strong>$user-&gt;unit_weight;<\/strong> \/\/ 55kg<\/pre>\n<h2>\u897f\u66a6\u304b\u3089\u548c\u66a6\u306b\u5909\u63db\u3059\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001birth_year\u3068\u3044\u3046\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u8a95\u751f\u5e74\u304c\u5165\u3063\u3066\u3044\u3066\u3001\u3053\u308c\u3092\u300c\u5e73\u6210\u25cf\u25cf\u5e74\u300d\u306a\u3069\u5143\u53f7\u3064\u304d\u306b\u5909\u63db\u3059\u308bAccessor\u3067\u3059\u3002<\/p>\n<pre>public function getBirthWarekiYearAttribute() {\r\n\r\n    $year = <strong>$this-&gt;birth_year<\/strong>;\r\n    $wareki_year = 0;\r\n\r\n    if ($year &gt;= 2019) {\r\n\r\n        $era_name = '\uff08\u65b0\u5143\u53f7\uff09';\r\n        $wareki_year = $year - 2018;\r\n\r\n    } else if ($year &gt;= 1989) {\r\n\r\n        $era_name = '\u5e73\u6210';\r\n        $wareki_year = $year - 1988;\r\n\r\n    } else if ($year &gt;= 1926) {\r\n\r\n        $era_name = '\u662d\u548c';\r\n        $wareki_year = $year - 1925;\r\n\r\n    } else if ($year &gt;= 1912) {\r\n\r\n        $era_name = '\u5927\u6b63';\r\n        $wareki_year = $year - 1911;\r\n\r\n    } else {\r\n\r\n        $era_name = '\u660e\u6cbb';\r\n        $wareki_year = $year - 1867;\r\n\r\n    }\r\n\r\n    $wareki_year = ($wareki_year == 1) ? '\u5143' : $wareki_year;\r\n    return $era_name . $wareki_year .'\u5e74';\r\n\r\n}<\/pre>\n<pre><strong>$user-&gt;birth_wareki_year;<\/strong> \/\/ \u300c\u5e73\u6210\u5143\u5e74\u300d\u300c\u662d\u548c60\u5e74\u300d\u306a\u3069<\/pre>\n<p>\u203b\u3061\u306a\u307f\u306b\u30012019\u5e74\u304b\u3089\u306f\u5143\u53f7\u304c\u5909\u66f4\u3059\u308b\u4e88\u5b9a\u3067\u3059\u304c\u3001\u307e\u3060\u65b0\u3057\u3044\u5143\u53f7\u304c\u6c7a\u307e\u3063\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u73fe\u6642\u70b9\u3067\u306f<code>\uff08\u65b0\u5143\u53f7\uff09<\/code>\u3068\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u203b\u307e\u305f\u3001\u6709\u52b9\u306a\u306e\u306f\u660e\u6cbb\u4ee5\u964d\u306e\u548c\u66a6\u3067\u3059\u3002<\/p>\n<h2>\uff13\u6841\u30ab\u30f3\u30de\u3092\u4ed8\u52a0\u3057\u305f\u6570\u5024\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001DB\u5185\u306b<code>amount<\/code>\u3068\u3044\u3046\u91d1\u984d\u3092\u4fdd\u5b58\u3059\u308b\u6570\u5024\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u3042\u3063\u305f\u3068\u3057\u307e\u3059\u3002\u305d\u3057\u3066\u3001\u3053\u306e\u6570\u5024\u30c7\u30fc\u30bf\u304b\u3089\u300c1,000,000\u300d\u3068\u3044\u3046\u3088\u3046\u306a\uff13\u6841\u3054\u3068\u306b\u30ab\u30f3\u30de\u3092\u3075\u3063\u305f\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre><strong>public function getCommaAmountAttribute() {<\/strong>\r\n\r\n<strong>    return number_format($this-&gt;amount);<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<pre><strong>$user-&gt;comma_amount;<\/strong> \/\/ 10,000<\/pre>\n<p>\u3082\u3057\u300c\u5186\u300d\u3082\u8ffd\u52a0\u3057\u305f\u3044\u5834\u5408\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>public function getYenAmountAttribute() {<\/strong>\r\n\r\n<strong>    return number_format($this-&gt;amount) .'\u5186';<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<pre><strong>$user-&gt;yen_amount;<\/strong> \/\/ 10,000\u5186<\/pre>\n<h2>\u6d88\u8cbb\u7a0e\u306e\u91d1\u984d\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001<code>amount<\/code>\u3068\u3044\u3046\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u5408\u8a08\u91d1\u984d\u304c\u6570\u5024\u30c7\u30fc\u30bf\u3068\u3057\u3066\u5165\u3063\u3066\u3044\u3066\u3001\u3053\u306e\u91d1\u984d\u306e\u6d88\u8cbb\u7a0e\u304c\u3044\u304f\u3089\u306a\u306e\u304b\u3092\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre><strong>public function getAmountTaxAttribute() {<\/strong>\r\n\r\n<strong>    $tax_percentage = 8;<\/strong>\r\n<strong>    return floor($this-&gt;amount * $tax_percentage * 0.01);<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<pre><strong>$user-&gt;amount_tax;<\/strong> \/\/ 800\uff08\u91d1\u984d\u304c10,000\u306e\u5834\u5408\uff09<\/pre>\n<p>\u203b \u3061\u306a\u307f\u306b\u6d88\u8cbb\u7a0e\u306f\u3069\u3093\u3069\u3093\u4e0a\u304c\u3063\u3066\u3044\u304f\u50be\u5411\u306b\u3042\u308a\u307e\u3059\u306e\u3067\u3001<code>config\/app.php<\/code>\u306a\u3069\u306e\u30b3\u30f3\u30d5\u30a3\u30b0\u30d5\u30a1\u30a4\u30eb\u304b\u3001\u3082\u3057\u304f\u306fDB\u5185\u306b\u7a0e\u7387\u3092\u683c\u7d0d\u3057\u3066\u3044\u3064\u3067\u3082\u5909\u66f4\u304c\u53ef\u80fd\u306b\u3057\u3066\u304a\u304f\u3053\u3068\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u6d88\u8cbb\u7a0e\u3092\u542b\u3093\u3060\u5408\u8a08\u91d1\u984d\u3092\u53d6\u5f97\u3059\u308b\u5834\u5408\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>public function getAmountIncludingTaxAttribute() {<\/strong>\r\n\r\n<strong>    $tax_percentage = 8;<\/strong>\r\n<strong>    $amount = $this-&gt;amount;<\/strong>\r\n<strong>    return $amount + floor($amount * $tax_percentage * 0.01);<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<pre><strong>$user-&gt;amount_including_tax;<\/strong> \/\/ 10800<\/pre>\n<h2>\u7ba1\u7406\u8005\u3068\u3057\u3066\u306e\u6a29\u9650\u304c\u3042\u308b\u304b\u3069\u3046\u304b\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u30e6\u30fc\u30b6\u30fc\u30c7\u30fc\u30bf\u306e\u4e2d\u306b<code>role<\/code>\u3068\u3044\u3046<code>admin<\/code>\uff08\u7ba1\u7406\u8005\uff09\u3084\u3001<code>user<\/code>\uff08\u901a\u5e38\u30e6\u30fc\u30b6\u30fc\uff09\u3068\u3044\u3063\u305f\u7a2e\u985e\u304c\u4fdd\u5b58\u3055\u308c\u3066\u3044\u3066\u3001\u3053\u306e\u30c7\u30fc\u30bf\u3092\u5143\u306b\u7ba1\u7406\u8005\u6a29\u9650\u304c\u3042\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5225\u3059\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre><strong>public function getHasPermissionAttribute() {<\/strong>\r\n\r\n<strong>    return ($this-&gt;role == 'admin');<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<p>\u4f7f\u3044\u65b9\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>if(<strong>$user-&gt;has_permission<\/strong>) {\r\n\r\n    \/\/ \u7ba1\u7406\u8005\u6a29\u9650\u3042\u308a\r\n\r\n}<\/pre>\n<h2>\u300c0001\u300d\u306e\u3088\u3046\u306a\u30bc\u30ed\u3067\u57cb\u3081\u3089\u308c\u305f\u30e6\u30fc\u30b6\u30fc\u30b3\u30fc\u30c9\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001<code>id<\/code>\u756a\u53f7\u3092\u30bc\u30ed\u3067\u57cb\u3081\u3089\u308c\u305f\uff14\u6841\u306e\u30b3\u30fc\u30c9\u3092\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre><strong>public function getUserCodeAttribute() {\r\n\r\n    return str_pad($this-&gt;id, 4, '0', STR_PAD_LEFT);\r\n\r\n}<\/strong><\/pre>\n<pre><strong>$user-&gt;user_code;<\/strong> \/\/ 0001<\/pre>\n<h2>\u90f5\u4fbf\u756a\u53f7\u3092\u7d50\u5408\u3057\u3066\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u30b5\u30a4\u30c8\u306b\u3088\u308a\u307e\u3059\u304c\u3001\u90f5\u4fbf\u756a\u53f7\u306e\u30c7\u30fc\u30bf\u3092\u4f8b\u3048\u3070<code>first_postal_code<\/code>\u3068<code>last_postal_code<\/code>\u3068\u3044\u3046\u3088\u3046\u306b\uff12\u3064\u306b\u5206\u3051\u3066\u7ba1\u7406\u3057\u3066\u3044\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u3093\u306a\u5834\u5408\u306b\u3053\u308c\u3089\u3092\u7d50\u5408\u3057\u305f<code>full_postal_code<\/code>\u3068\u3057\u3066\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>public function getFullPostalCodeAttribute() {<\/strong>\r\n\r\n<strong>    return $this-&gt;first_postal_code .'-'. $this-&gt;last_postal_code;<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<pre><strong>$user-&gt;full_postal_code;<\/strong> \/\/ 131-0045<\/pre>\n<h2>Google\u30de\u30c3\u30d7\u306eURL\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u4f1a\u54e1\u30c7\u30fc\u30bf\u306b\u4f4f\u6240\u304c\u4fdd\u5b58\u3055\u308c\u3066\u3044\u3066\u3001\u305d\u306e\u5834\u6240\u3092Google\u30de\u30c3\u30d7\u3067\u8868\u793a\u3059\u308b\u5834\u5408\u306b\u5fc5\u8981\u306aURL\u3092\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre><strong>public function getGoogleMapUrlAttribute() {<\/strong>\r\n\r\n<strong>    return 'https:\/\/www.google.co.jp\/maps\/place\/'. urlencode($this-&gt;address);<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<pre><strong>$user-&gt;google_map_url;<\/strong> \/\/ https:\/\/www.google.co.jp\/maps\/place\/%E6%9D%B1%E4%BA%AC%E9%83%BD%E5%A2%A8%E7%94%B0%E5%8C%BA%E6%8A%BC%E4%B8%8A%EF%BC%91%E4%B8%81%E7%9B%AE%EF%BC%91%E2%88%92%EF%BC%92<\/pre>\n<h2>\u5f79\u8077\u540d\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001<code>position_id<\/code>\u3068\u3044\u3046\u5f79\u8077\u540d\u30de\u30b9\u30bf\u30fc\u306eID\u3092\u4fdd\u5b58\u3057\u3066\u3044\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u3042\u308b\u3068\u3057\u3066\u3001\u3053\u3053\u304b\u3089\u5b9f\u969b\u306e\u5f79\u8077\u540d\u3092\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre><strong>public function getPositionNameAttribute() {<\/strong>\r\n\r\n<strong>    $positions = [<\/strong>\r\n<strong>        1 =&gt; '\u4f1a\u9577',<\/strong>\r\n<strong>        2 =&gt; '\u793e\u9577',<\/strong>\r\n<strong>        3 =&gt; '\u526f\u793e\u9577',<\/strong>\r\n<strong>        4 =&gt; '\u5c02\u52d9',<\/strong>\r\n<strong>        5 =&gt; '\u5e38\u52d9',<\/strong>\r\n<strong>        6 =&gt; '\u652f\u793e\u9577',<\/strong>\r\n<strong>        7 =&gt; '\u672c\u90e8\u9577',<\/strong>\r\n<strong>        8 =&gt; '\u90e8\u9577',<\/strong>\r\n<strong>        9 =&gt; '\u6b21\u9577',<\/strong>\r\n<strong>        10 =&gt; '\u5ba4\u9577',<\/strong>\r\n<strong>        11 =&gt; '\u8ab2\u9577',<\/strong>\r\n<strong>        12 =&gt; '\u4fc2\u9577',<\/strong>\r\n<strong>        13 =&gt; '\u4e3b\u4efb'<\/strong>\r\n<strong>    ];<\/strong>\r\n<strong>    return array_get($positions, $this-&gt;position_id);<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<pre><strong>$user-&gt;position_name<\/strong>; \/\/ \u4f1a\u9577<\/pre>\n<h2>\u90e8\u7f72\u540d\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001<code>section_id<\/code>\u3068\u3044\u3046\u90e8\u7f72ID\u3092\u4fdd\u5b58\u3059\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u304b\u3089\u5b9f\u969b\u306e\u90e8\u7f72\u540d\u3092\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre><strong>public function getSectionNameAttribute() {<\/strong>\r\n\r\n<strong>    $sections = [<\/strong>\r\n<strong>        1 =&gt; '\u7dcf\u52d9\u90e8',<\/strong>\r\n<strong>        2 =&gt; '\u4eba\u4e8b\u90e8',<\/strong>\r\n<strong>        3 =&gt; '\u7d4c\u7406\u90e8',<\/strong>\r\n<strong>        4 =&gt; '\u55b6\u696d\u90e8',<\/strong>\r\n<strong>        5 =&gt; '\u958b\u767a\u90e8',<\/strong>\r\n<strong>        6 =&gt; '\u4e8b\u696d\u90e8',<\/strong>\r\n<strong>        7 =&gt; '\u88fd\u9020\u90e8'<\/strong>\r\n<strong>    ];<\/strong>\r\n<strong>    return array_get($sections, $this-&gt;section_id);<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<pre><strong>$user-&gt;section_name;<\/strong> \/\/ \u958b\u767a\u90e8<\/pre>\n<h1>\u30d5\u30a1\u30a4\u30eb\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/h1>\n<p>\u4eca\u56de\u5b9f\u969b\u306b\u4f7f\u7528\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u30fb\u30b3\u30fc\u30c9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002<br \/>\n\u305c\u3072\u3054\u81ea\u8eab\u306e\u958b\u767a\u306b\u5f79\u7acb\u3066\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<a  data-e-Disable-Page-Transition=\"true\" class=\"download-link\" title=\"\" href=\"https:\/\/blog.capilano-fw.com?download=1250&amp;tmstv=1777539712\" rel=\"nofollow\" id=\"download-link-1250\" data-redirect=\"false\" >\n\t\u3010\u30b5\u30f3\u30d7\u30eb\u3011Laravel\u30fb\u4f7f\u3044\u56de\u3057\u3067\u304d\u308bAccessor\u5b9f\u4f8b<\/a>\n\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u4eca\u56de\u306fLaravel\u306e\u5f37\u529b\u306a\u4fbf\u5229\u6a5f\u80fdAccessor\u306b\u30d5\u30a9\u30fc\u30ab\u30b9\u3057\u3066\u8a18\u4e8b\u3092\u66f8\u3044\u3066\u898b\u307e\u3057\u305f\u3002<\/p>\n<p>\u306f\u3084\u308a\u3053\u306e\u6a5f\u80fd\u304c\u3042\u308b\u3060\u3051\u3067\u3001\u958b\u767a\u306e\u30b9\u30d4\u30fc\u30c9\u3092\u4e0a\u3052\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3067\u3057\u3087\u3046\u3057\u3001\u4f55\u304b\u5909\u66f4\u70b9\u304c\u3042\u3063\u3066\u3082Accessor\u90e8\u5206\u3092\u5909\u66f4\u3059\u308c\u3070\u5168\u3066\u306e\u30b3\u30fc\u30c9\u306b\u53cd\u6620\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u4fdd\u5b88\u7ba1\u7406\u306b\u3082\u30d7\u30e9\u30b9\u3068\u3044\u3063\u3066\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305f\u3001\u7279\u306b\u6c4e\u7528\u7684\u306b\u3088\u304f\u4f7f\u3046Accessor\u306f\u3001\u30c8\u30ec\u30a4\u30c8\u306b\u307e\u3068\u3081\u3066\u4ed6\u306e\u30e2\u30c7\u30eb\u3067\u5171\u6709\u3057\u3066\u3082\u3044\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<pre>class User extends Authenticatable\r\n{\r\n    use AccessorTrait;\r\n\r\n    \/\/ \u7701\u7565\r\n\r\n}<\/pre>\n<pre>trait AccessorTrait {\r\n    \r\n    \/\/ \u3053\u3053\u306bAccessor\r\n\r\n}<\/pre>\n<p>\u3067\u304d\u308b\u3060\u3051\u30b3\u30fc\u30c9\u306f\u4e00\u56de\u66f8\u304f\u3060\u3051\u3067\u4f7f\u3044\u56de\u3057\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u3051\u3070\u3001\u6b21\u306e\u958b\u767a\u3067\u306f\u3088\u308a\u30b9\u30d4\u30fc\u30c7\u30a3\u306a\u5bfe\u5fdc\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u305c\u3072\u6d3b\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-461 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/38.png\" alt=\"\" width=\"294\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/38.png 294w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/38-276x300.png 276w\" sizes=\"auto, (max-width: 294px) 100vw, 294px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001Laravel 5.7\u00a0\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u305f\u95a2\u4fc2\u3067\u3001\u6700\u8fd1\u306f\u4e3b\u306b\u65b0\u3057\u3044\u6a5f\u80fd\u306b\u3064\u3044\u3066\u306e\u8a18\u4e8b\u3092\u516c\u958b\u3057\u3066\u304d\u307e\u3057\u305f\u304c\u3001\u3053\u306e\u8fba\u3067Laravel\u306e\u57fa\u672c\u7684\u306a\u6a5f\u80fd\u306b\u3064\u3044\u3066\u3082 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=1241\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u516815\u4ef6\uff01Laravel\u30fb\u4f7f\u3044\u56de\u3057\u3067\u304d\u308bAccessor\u5b9f\u4f8b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":1258,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,97],"tags":[86],"class_list":["post-1241","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","category-97","tag-accessor"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/1241","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=1241"}],"version-history":[{"count":12,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/1241\/revisions"}],"predecessor-version":[{"id":1257,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/1241\/revisions\/1257"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/1258"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}