{"id":493,"date":"2018-05-11T03:52:08","date_gmt":"2018-05-10T18:52:08","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=493"},"modified":"2018-05-11T03:52:08","modified_gmt":"2018-05-10T18:52:08","slug":"laravel%e3%81%ae%e4%be%bf%e5%88%a9%e3%81%aa%e3%82%b3%e3%83%ac%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3%e3%83%bb%e3%83%a1%e3%82%bd%e3%83%83%e3%83%89%ef%bc%97%e9%81%b8%ef%bc%81","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=493","title":{"rendered":"Laravel\u306e\u4fbf\u5229\u306a\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30fb\u30e1\u30bd\u30c3\u30c9\uff17\u9078\uff01"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u3053\u306e\u3068\u3053\u308dLaravel\u95a2\u9023\u306e\u8a18\u4e8b\u306b\u30a2\u30af\u30bb\u30b9\u304c\u591a\u304f\u306a\u3063\u3066\u304d\u3066\u3044\u308b\u3088\u3046\u3067\u3001\u30c9\u7d20\u4eba\u306e\u6587\u7ae0\u306a\u304c\u3089\u8aad\u3093\u3067\u304f\u308c\u3066\u3044\u308b\u4eba\u305f\u3061\u306b\u611f\u8b1d\u3057\u3066\u3044\u308b\u4eca\u65e5\u3053\u306e\u9803\u3067\u3059\u3002m_ _m<\/p>\n<p>\u3067\u3001\u305d\u3093\u306aLaravel\u3067\u3059\u304c\u73fe\u5728\u3082\u958b\u767a\u304c\u30c9\u30f3\u30c9\u30f3\u9032\u3093\u3067\u3044\u3066\u4e00\u9031\u9593\u304b\u4e8c\u9031\u9593\u3059\u308b\u3068\u5fc5\u305a\u3068\u3044\u3063\u3066\u3082\u3044\u3044\u307b\u3069\u30de\u30a4\u30ca\u30fc\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3055\u308c\u3001\u305d\u306e\u90fd\u5ea6\u4fbf\u5229\u306a\u95a2\u6570\u3084\u30e1\u30bd\u30c3\u30c9\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f\u3068\u3066\u3082\u5b09\u3057\u3044\u534a\u9762\u3001\u304d\u3061\u3093\u3068\u30c1\u30a7\u30c3\u30af\u3057\u3066\u304a\u304b\u306a\u3044\u3068\u305b\u3063\u304b\u304f\u7528\u610f\u3055\u308c\u3066\u308b\u4fbf\u5229\u306a\u6a5f\u80fd\u3092\u77e5\u3089\u306a\u3044\u3068\u3044\u3046\u72b6\u614b\u306b\u306a\u308a\u3001\u3042\u3068\u304b\u3089<\/p>\n<p><strong style=\"font-size: 35px;\">\u300c\u3048\u3063\u3001\u3053\u3093\u306a\u4fbf\u5229\u306a\u66f8\u304d\u65b9\u3067\u304d\u308b\u306e\uff01\uff1f\u3086\u3063\u3066\u3088\u301c\u30fb\u30fb\u30fb\u300d<\/strong><\/p>\n<p>\u3063\u3066\u306a\u308b\u3053\u3068\u3082\u305f\u307e\u306b\u3042\u3063\u305f\u308a\u3057\u307e\u3059\u3002\uff08\u306a\u306e\u3067\u4eca\u306f\u3001<a href=\"https:\/\/laravel-news.com\/\" target=\"_blank\" rel=\"noopener\">Laravel News<\/a> \u306b\u767b\u9332\u3057\u3066\u30e1\u30fc\u30eb\u30de\u30ac\u30b8\u30f3\u3092\u8cfc\u8aad\u3057\u3066\u3044\u307e\u3059\u3002 ^^;\uff09<\/p>\n<p>\u305d\u3057\u3066\u3001\u305d\u3093\u306aLaravel\u306e\u7279\u5fb4\u306e\u3072\u3068\u3064\u3068\u3044\u3063\u3066\u3082\u3044\u3044\u300c\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u300d\u3082\u305d\u306e\u4f8b\u5916\u3067\u306f\u306a\u304f\u3001\u65b0\u3057\u3044\u30e1\u30bd\u30c3\u30c9\u304c\u30c9\u30f3\u30c9\u30f3\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u3053\u3053\u3044\u3089\u3067\u3053\u306e\u524d\u516c\u958b\u3057\u305f\u300c<a href=\"https:\/\/blog.capilano-fw.com\/?p=320\">Laravel\u306e\u3088\u304f\u4f7f\u3046\u30d8\u30eb\u30d1\u30fc\u95a2\u6570\uff17\u9078\uff01<\/a>\u300d\u306e\u3088\u3046\u306b\u3001\u500b\u4eba\u7684\u306b\u4fbf\u5229\u3060\u3068\u601d\u3046\u30e1\u30bd\u30c3\u30c9\u3092\uff17\u3064\u9078\u3093\u3067\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u305c\u3072\u3001\u300c\u50cd\u304d\u65b9\u6539\u9769\u300d\u306e\u6ce2\u306b\u306e\u3063\u3066\u6642\u77ed\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306b\u5f79\u7acb\u3066\u3066\u304f\u3060\u3055\u3044\uff08\u7b11\uff09<\/p>\n<h1>groupBy()\u3000\u5024\u304c\u540c\u3058\u3082\u306e\u3067\u30b0\u30eb\u30fc\u30d7\u5316<\/h1>\n<p>\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306egroupBy()\u306f\u3001\u5024\u304c\u540c\u3058\u3082\u306e\u3067\u30b0\u30eb\u30fc\u30d7\u5316\u3092\u3059\u308b\u3068\u3044\u3046\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u4f1a\u54e1\u30c7\u30fc\u30bf\u304c\u3042\u3063\u305f\u3068\u3057\u307e\u3059\u3002<\/p>\n<pre>$collection = collect([\r\n    ['name' =&gt; '\u5c71\u7530', <strong>'pref' =&gt; '\u6771\u4eac'<\/strong>],\r\n    ['name' =&gt; '\u9234\u6728', <strong>'pref' =&gt; '\u5927\u962a'<\/strong>],\r\n    ['name' =&gt; '\u4f50\u85e4', <strong>'pref' =&gt; '\u6771\u4eac'<\/strong>],\r\n    ['name' =&gt; '\u7530\u4e2d', <strong>'pref' =&gt; '\u5317\u6d77\u9053'<\/strong>],\r\n    ['name' =&gt; '\u5c71\u672c', <strong>'pref' =&gt; '\u5927\u962a'<\/strong>]\r\n]);<\/pre>\n<p>\u305d\u3057\u3066\u3001\u3082\u3057\u3053\u306e\u4f1a\u54e1\u305f\u3061\u3092\u51fa\u8eab\u5730\uff08pref\uff09\u3054\u3068\u306b\u5206\u3051\u305f\u3044\u5834\u5408\u3001<strong>groupBy()<\/strong>\u304c\u4f7f\u3048\u307e\u3059\u3002<\/p>\n<pre>$grouped = $collection-&gt;<strong>groupBy('pref')<\/strong>;<\/pre>\n<p>\u7d50\u679c\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$results = [\r\n    '<strong>\u6771\u4eac<\/strong>' =&gt; [\r\n        ['name' =&gt; '\u5c71\u7530', 'pref' =&gt; '\u6771\u4eac'],\r\n        ['name' =&gt; '\u4f50\u85e4', 'pref' =&gt; '\u6771\u4eac']\r\n    ],\r\n    '<strong>\u5927\u962a<\/strong>' =&gt; [\r\n        ['name' =&gt; '\u9234\u6728', 'pref' =&gt; '\u5927\u962a'],\r\n        ['name' =&gt; '\u5c71\u672c', 'pref' =&gt; '\u5927\u962a']\r\n    ],\r\n    '<strong>\u5317\u6d77\u9053<\/strong>' =&gt; [\r\n        ['name' =&gt; '\u5c71\u672c', 'pref' =&gt; '\u5317\u6d77\u9053']\r\n    ]\r\n];<\/pre>\n<p>\u3061\u306a\u307f\u306b\u3001\u3053\u306e\u4f8b\u3067\u306f\u308f\u304b\u308a\u3084\u3059\u304f\u3059\u308b\u305f\u3081\u306b\u300c\u6771\u4eac\u300d\u306a\u3069\u5168\u89d2\u6587\u5b57\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u305d\u3046\u306a\u308b\u3068<strong>\u30ad\u30fc\u306e\u4e2d\u8eab\u3082\u5168\u89d2\u6587\u5b57\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u306e\u3067\u6c17\u3092\u3064\u3051\u3066\u304f\u3060\u3055\u3044\u3002<\/strong>\u5b9f\u969b\u306e\u30b3\u30fc\u30c9\u3067\u306f\u534a\u89d2\u6587\u5b57\u3092\u3064\u304b\u3046\u3079\u304d\u65b9\u304c\u3044\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3082\u3057\u3001\u3069\u3046\u3057\u3066\u5168\u89d2\u6587\u5b57\u3092\u4f7f\u3063\u305f\u30b0\u30eb\u30fc\u30d7\u5316\u3092\u3057\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5f15\u6570\u3092\u95a2\u6570\u5316\u3059\u308c\u3070\u3001\u30ad\u30fc\u3092\u81ea\u7531\u306b\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>$grouped = $collection-&gt;<strong>groupBy<\/strong>(function($item, $key){\r\n\r\n    $prefs = [\r\n        'tokyo' =&gt; '\u6771\u4eac',\r\n        'osaka' =&gt; '\u5927\u962a',\r\n        'hokkaido' =&gt; '\u5317\u6d77\u9053'\r\n    ];\r\n    <strong>return array_search($item['pref'], $prefs);<\/strong>\r\n\r\n});<\/pre>\n<p>\u3084\u3063\u3066\u308b\u3053\u3068\u306f\u3001$item\u304b\u3089\u90fd\u9053\u5e9c\u770c\u540d\u3092\u62bd\u51fa\u3057\u3066\u3001return \u306e\u90e8\u5206\u3067\u8a72\u5f53\u3059\u308b\u90fd\u9053\u5e9c\u770c\u30ad\u30fc\u3092array_search()\u3092\u4f7f\u3063\u3066\u8fd4\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u3001\u7d50\u679c\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$results = [\r\n    '<strong>tokyo<\/strong>' =&gt; [\r\n        ['name' =&gt; '\u5c71\u7530', 'pref' =&gt; '\u6771\u4eac'],\r\n        ['name' =&gt; '\u4f50\u85e4', 'pref' =&gt; '\u6771\u4eac']\r\n    ],\r\n    '<strong>osaka<\/strong>' =&gt; [\r\n        ['name' =&gt; '\u9234\u6728', 'pref' =&gt; '\u5927\u962a'],\r\n        ['name' =&gt; '\u5c71\u672c', 'pref' =&gt; '\u5927\u962a']\r\n    ],\r\n    '<strong>hokkaido<\/strong>' =&gt; [\r\n        ['name' =&gt; '\u5c71\u672c', 'pref' =&gt; '\u5317\u6d77\u9053']\r\n    ]\r\n];<\/pre>\n<p>\u3068\u3066\u3082\u4fbf\u5229\u3067\u3059\u306d\uff01<\/p>\n<h1>map()\u3000\u5168\u8981\u7d20\u306b\u8272\u3005\u306a\u52a0\u5de5\u3092\u3059\u308b<\/h1>\n<p>map()\u3092\u4f7f\u3048\u3070\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u5168\u8981\u7d20\u306b\u8272\u3005\u306a\u52a0\u5de5\u3092\u52a0\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u305f\u3068\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5e74\u9f62\u304c\u5165\u3063\u305f\u4f1a\u54e1\u30c7\u30fc\u30bf\u304c\u3042\u3063\u305f\u3068\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>$collection = collect([\r\n    ['name' =&gt; '\u5c71\u7530', <strong>'age' =&gt; 22<\/strong>],\r\n    ['name' =&gt; '\u9234\u6728', <strong>'age' =&gt; 25<\/strong>],\r\n    ['name' =&gt; '\u4f50\u85e4', <strong>'age' =&gt; 18<\/strong>],\r\n    ['name' =&gt; '\u7530\u4e2d', <strong>'age' =&gt; 30<\/strong>],\r\n    ['name' =&gt; '\u5c71\u672c', <strong>'age' =&gt; 16<\/strong>]\r\n]);<\/pre>\n<p>\u305d\u3057\u3066\u3001\u4f8b\u3048\u3070<strong>\u540d\u524d\u306e\u5f8c\u308d\u306b\u5e74\u9f62\u3082\u8868\u793a<\/strong>\u3059\u308b\u306a\u3089\u3001map()\u304c\u4f7f\u3048\u307e\u3059\u3002<\/p>\n<pre>$multiplied = $collection-&gt;<strong>map<\/strong>(function($item, $key){\r\n\r\n    <strong>$item['name'] .= '\uff08'. $item['age'] .'\u624d\uff09';<\/strong>\r\n    return $item;\r\n\r\n});<\/pre>\n<p>map()\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u5168\u8981\u7d20\u306e$item\u3068$value\u304c\u53d6\u5f97\u3067\u304d\u308b\u306e\u3067\u3001\u3053\u308c\u3089\u306e\u30c7\u30fc\u30bf\u3092\u4f7f\u3063\u3066\u52a0\u5de5\u3092\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u7d50\u679c\u306f\u3001<\/p>\n<pre>$results = [\r\n    ['name' =&gt; '<strong>\u5c71\u7530\uff0822\u624d\uff09<\/strong>', 'age' =&gt; 22],\r\n    ['name' =&gt; '<strong>\u9234\u6728\uff0825\u624d\uff09<\/strong>', 'age' =&gt; 25],\r\n    ['name' =&gt; '<strong>\u4f50\u85e4\uff0818\u624d\uff09<\/strong>', 'age' =&gt; 18],\r\n    ['name' =&gt; '<strong>\u7530\u4e2d\uff0830\u624d\uff09<\/strong>', 'age' =&gt; 30],\r\n    ['name' =&gt; '<strong>\u5c71\u672c\uff0816\u624d\uff09<\/strong>', 'age' =&gt; 16]\r\n];<\/pre>\n<p>\u3068\u3044\u3046\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3082\u3061\u308d\u3093\u3001\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3059\u308b\u3068\u65b0\u3057\u3044\u300cage_unit\u300d\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>$multiplied = $collection-&gt;<strong>map<\/strong>(function($item, $key){\r\n\r\n    <strong>$item['age_unit'] = $item['age'] .'\u624d';<\/strong>\r\n    return $item;\r\n\r\n});<\/pre>\n<p>\u7d50\u679c\u306f\u3001\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$results = [\r\n    ['name' =&gt; '\u5c71\u7530', 'age' =&gt; 22, <strong>'age_unit' =&gt; '22\u624d'<\/strong>],\r\n    ['name' =&gt; '\u9234\u6728', 'age' =&gt; 25, <strong>'age_unit' =&gt; '25\u624d'<\/strong>],\r\n    ['name' =&gt; '\u4f50\u85e4', 'age' =&gt; 18, <strong>'age_unit' =&gt; '18\u624d'<\/strong>],\r\n    ['name' =&gt; '\u7530\u4e2d', 'age' =&gt; 30, <strong>'age_unit' =&gt; '30\u624d'<\/strong>],\r\n    ['name' =&gt; '\u5c71\u672c', 'age' =&gt; 16, <strong>'age_unit' =&gt; '16\u624d'<\/strong>]\r\n];<\/pre>\n<p>\u203b\u3082\u3057\u3001\u30e2\u30c7\u30eb\u3092\u4f7f\u3063\u305f\u5834\u5408\u3060\u3068<a href=\"https:\/\/laravel.com\/docs\/5.6\/eloquent-mutators#accessors-and-mutators\" target=\"_blank\" rel=\"noopener\">accessor<\/a>\u304c\u3042\u308b\u306e\u3067\u3001\u305d\u3063\u3061\u306e\u4f7f\u3046\u624b\u3082\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h1>chunk()\u3000\u6307\u5b9a\u3055\u308c\u305f\u6570\u3054\u3068\u306b\u5206\u5272<\/h1>\n<p>chunk\u3092\u4f7f\u3046\u3068\u3001\u305f\u304f\u3055\u3093\u306e\u30c7\u30fc\u30bf\u3092\u300c\uff12\u500b\u305a\u3064\u300d\u3068\u304b\u300c\uff13\u500b\u305a\u3064\u300d\u3068\u3044\u3046\u3088\u3046\u306b\u30c7\u30fc\u30bf\u306e\u5206\u5272\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306e\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>$collection = collect([\r\n    ['name' =&gt; '\u5c71\u7530'],\r\n    ['name' =&gt; '\u9234\u6728'],\r\n    ['name' =&gt; '\u4f50\u85e4'],\r\n    ['name' =&gt; '\u7530\u4e2d'],\r\n    ['name' =&gt; '\u5c71\u672c'],\r\n]);\r\n$chunks = $collection-&gt;<strong>chunk(2)<\/strong>;<\/pre>\n<p>\u3053\u308c\u306f\u3001\u540d\u524d\u306e\u30c7\u30fc\u30bf\u3092\uff12\u3064\u305a\u3064\u306b\u5206\u3051\u308b\u30b3\u30fc\u30c9\u3067\u3001\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$results = [\r\n    '0' =&gt; [\r\n        ['0' =&gt; ['name' =&gt; '\u5c71\u7530']],\r\n        ['1' =&gt; ['name' =&gt; '\u9234\u6728']]\r\n    ],\r\n    '1' =&gt; [\r\n        ['2' =&gt; ['name' =&gt; '\u4f50\u85e4']],\r\n        ['3' =&gt; ['name' =&gt; '\u7530\u4e2d']]\r\n    ],\r\n    '2' =&gt; [\r\n        ['4' =&gt; ['name' =&gt; '\u5c71\u672c']]\r\n    ]\r\n];<\/pre>\n<p>\u3061\u306a\u307f\u306b\u3053\u308c\u304c\u3069\u3053\u3067\u5f79\u7acb\u3064\u304b\u3068\u3044\u3046\u3068\u3001\u6b21\u306e\u3088\u3046\u306a\u300c\u6bb5\u7d44\u307f\u3055\u308c\u305f\u8868\u793a\u300d\u3092\u3057\u305f\u3044\u3068\u304d\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-495\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/05\/2-Col-Portfolio-Start-Bootstrap-Template.png\" alt=\"\" width=\"1341\" height=\"1886\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/05\/2-Col-Portfolio-Start-Bootstrap-Template.png 1341w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/05\/2-Col-Portfolio-Start-Bootstrap-Template-213x300.png 213w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/05\/2-Col-Portfolio-Start-Bootstrap-Template-768x1080.png 768w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/05\/2-Col-Portfolio-Start-Bootstrap-Template-728x1024.png 728w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<p>\u3064\u307e\u308a\u3001\u3053\u3093\u306a\u30ab\u30f3\u30b8\u3067 foreach()\u3092\uff12\u3064\u4f7f\u3063\u3066\u3084\u308b\u3068\u7c21\u5358\u306b\uff12\u6bb5\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3067\u304d\u308b\u3068\u3044\u3046\u308f\u3051\u3067\u3059\u306d\u3002<\/p>\n<pre>&lt;table&gt;\r\n    @foreach ($chunks as $items)\r\n    &lt;tr&gt;\r\n        @foreach ($items as $item)\r\n\r\n            &lt;td&gt;{{ $item['name'] }}&lt;\/td&gt;\r\n\r\n        @endforeach\r\n    &lt;\/tr&gt;\r\n    @endforeach\r\n&lt;\/table&gt;<\/pre>\n<h1>sortBy(sortByDesc)\u3000\u3042\u308b\u30c7\u30fc\u30bf\u9806\u306b\u4e26\u3079\u66ff\u3048<\/h1>\n<p>sortBy()\u3068sortByDesc()\u3092\u4f7f\u3046\u3068\u3001\u3042\u308b\u7279\u5b9a\u306e\u30c7\u30fc\u30bf\u9806\u306b\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30fb\u30c7\u30fc\u30bf\u3092\u4e26\u3079\u66ff\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30c6\u30b9\u30c8\u306e\u70b9\u6570\u304c\u5165\u3063\u305f\u751f\u5f92\u306e\u30c7\u30fc\u30bf\u304c\u3042\u3063\u305f\u3068\u3057\u307e\u3059\u3002<\/p>\n<pre>$collection = collect([\r\n    ['name' =&gt; '\u5c71\u7530', <strong>'score' =&gt; 98<\/strong>],\r\n    ['name' =&gt; '\u9234\u6728', <strong>'score' =&gt; 85<\/strong>],\r\n    ['name' =&gt; '\u4f50\u85e4', <strong>'score' =&gt; 32<\/strong>],\r\n    ['name' =&gt; '\u7530\u4e2d', <strong>'score' =&gt; 77<\/strong>],\r\n    ['name' =&gt; '\u5c71\u672c', <strong>'score' =&gt; 91<\/strong>]\r\n]);<\/pre>\n<p>\u3053\u308c\u3092\u3001\u70b9\u6570\u9806\u306b\u4e26\u3079\u66ff\u3048\u305f\u3044\u3001\u305d\u3093\u306a\u3068\u304d\u306bsortBy()\u3092\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>$sorted = $collection-&gt;<strong>sortBy('score')<\/strong>;<\/pre>\n<p>\u7d50\u679c\u306f\u3001\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$results = [\r\n    2 =&gt; ['name' =&gt; '\u4f50\u85e4', <strong>'score' =&gt; 32<\/strong>],\r\n    3 =&gt; ['name' =&gt; '\u7530\u4e2d', <strong>'score' =&gt; 77<\/strong>],\r\n    1 =&gt; ['name' =&gt; '\u9234\u6728', <strong>'score' =&gt; 85<\/strong>],\r\n    4 =&gt; ['name' =&gt; '\u5c71\u672c', <strong>'score' =&gt; 91<\/strong>],\r\n    0 =&gt; ['name' =&gt; '\u5c71\u7530', <strong>'score' =&gt; 98<\/strong>],\r\n];<\/pre>\n<p>\u305f\u3060\u3001\u3053\u3053\u3067\u6c17\u3092\u3064\u3051\u3066\u304a\u304b\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3053\u3068\u304c\uff11\u3064\u3042\u308a\u307e\u3059\uff01\u305d\u308c\u306f\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">\u30ad\u30fc\u304c\u4fdd\u6301\u3055\u308c\u3066\u3044\u308b<\/strong><\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002\u3082\u3057\u3001\u30ad\u30fc\u3082\u9806\u306b\u4e26\u3079\u66ff\u3048\u305f\u3044\u3068\u304d\u306f\u3001values()\u3092\u304b\u307e\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre>$sorted = $collection-&gt;sortBy('score')-&gt;<strong>values()<\/strong>;<\/pre>\n<p>\u3053\u308c\u3067\u3001\u30ad\u30fc\u3082\u70b9\u6570\u9806\u306b\u4e26\u3073\u66ff\u3048\u3089\u308c\u307e\u3057\u305f\u3002<\/p>\n<pre>$results = [\r\n    <strong>0<\/strong> =&gt; ['name' =&gt; '\u4f50\u85e4', 'score' =&gt; 32],\r\n    <strong>1<\/strong> =&gt; ['name' =&gt; '\u7530\u4e2d', 'score' =&gt; 77],\r\n    <strong>2<\/strong> =&gt; ['name' =&gt; '\u9234\u6728', 'score' =&gt; 85],\r\n    <strong>3<\/strong> =&gt; ['name' =&gt; '\u5c71\u672c', 'score' =&gt; 91],\r\n    <strong>4<\/strong> =&gt; ['name' =&gt; '\u5c71\u7530', 'score' =&gt; 98],\r\n];<\/pre>\n<p>\u203b\u3082\u3057\u9006\u306b\u70b9\u6570\u304c\u591a\u3044\u9806\u306b\u3057\u305f\u3044\u5834\u5408\u306f\u3001sortByDesc()\u3092\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002\u4f7f\u3044\u65b9\u306f\u540c\u3058\u3067\u3059\u3002<\/p>\n<h1>filter()\u3000\u5fc5\u8981\u306a\u30c7\u30fc\u30bf\u3060\u3051\u3092\u30b2\u30c3\u30c8<\/h1>\n<p>filter()\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3048\u3070\u3001\u7c21\u5358\u306b\u5fc5\u8981\u306e\u3042\u308b\u30c7\u30fc\u30bf\u3060\u3051\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u3053\u306e\u3088\u3046\u306a\u6240\u5c5e\u3057\u3066\u3044\u308b\u90e8\u6d3b\u304c\u308f\u304b\u308b\u751f\u5f92\u30c7\u30fc\u30bf\u304c\u3042\u3063\u305f\u3068\u3057\u307e\u3059\u3002<\/p>\n<pre>$collection = collect([\r\n    ['name' =&gt; '\u5c71\u7530', <strong>'club' =&gt; '\u91ce\u7403\u90e8'<\/strong>],\r\n    ['name' =&gt; '\u9234\u6728', <strong>'club' =&gt; '\u30b5\u30c3\u30ab\u30fc\u90e8'<\/strong>],\r\n    ['name' =&gt; '\u4f50\u85e4', <strong>'club' =&gt; '\u5353\u7403\u90e8'<\/strong>],\r\n    ['name' =&gt; '\u7530\u4e2d', <strong>'club' =&gt; '\u91ce\u7403\u90e8'<\/strong>],\r\n    ['name' =&gt; '\u5c71\u672c', <strong>'club' =&gt; '\u91ce\u7403\u90e8'<\/strong>]\r\n]);<\/pre>\n<p>\u3053\u306e\u4e2d\u304b\u3089\u3001<strong>\u91ce\u7403\u90e8\u306b\u6240\u5c5e\u3057\u3066\u308b\u4eba\u305f\u3061\u3060\u3051\u3092\u30d4\u30c3\u30af\u30a2\u30c3\u30d7<\/strong>\u3057\u305f\u3044\u3068\u304d\u306b<strong>filter()<\/strong>\u304c\u4f7f\u3048\u307e\u3059\u3002<\/p>\n<pre>$filtered = $collection-&gt;<strong>filter<\/strong>(function ($item, $key) {\r\n\r\n    \/\/ \u3053\u3053\u304ctrue\u306e\u3082\u306e\u3060\u3051\u6b8b\u308b\r\n    <strong>return ($item['club'] == '\u91ce\u7403\u90e8');<\/strong>\r\n\r\n});<\/pre>\n<p>\u4f7f\u3044\u65b9\u306f\u7c21\u5358\u3067\u3001<strong>true \u3092\u8fd4\u305b\u3070\u305d\u306e\u30c7\u30fc\u30bf\u306f\u6b8b\u308a\u3001false\u306e\u5834\u5408\u306f\u305d\u306e\u30c7\u30fc\u30bf\u306f $filtered \u306b\u306f\u5165\u3063\u3066\u304d\u307e\u305b\u3093\u3002<\/strong><\/p>\n<p>\u7d50\u679c\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$results = [\r\n    0 =&gt; ['name' =&gt; '\u5c71\u7530', 'club' =&gt; '<strong>\u91ce\u7403\u90e8<\/strong>'],\r\n    3 =&gt; ['name' =&gt; '\u7530\u4e2d', 'club' =&gt; '<strong>\u91ce\u7403\u90e8<\/strong>'],\r\n    4 =&gt; ['name' =&gt; '\u5c71\u672c', 'club' =&gt; '<strong>\u91ce\u7403\u90e8<\/strong>'],\r\n];<\/pre>\n<p>filter()\u3082\u30ad\u30fc\u304c\u524d\u306e\u307e\u307e\u4fdd\u6301\u3055\u308c\u308b\u306e\u3067\u3001\u3082\u3057\u30ad\u30fc\u3092\u30bc\u30ed\u304b\u3089\u4e26\u3079\u66ff\u3048\u305f\u3044\u5834\u5408\u306fvalues()\u3092\u8ffd\u52a0\u3057\u3066\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>$filtered = $collection-&gt;filter(function ($item, $key) {\r\n\r\n    return ($item['club'] == '\u91ce\u7403\u90e8');\r\n\r\n})-&gt;<strong>values()<\/strong>;<\/pre>\n<h1>dd()\u3000\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u4e2d\u8eab\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b<\/h1>\n<p>dd()\u3092\u4f7f\u3046\u3068\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u4e2d\u8eab\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u305d\u3053\u3060\u3051\u898b\u308b\u3068toArray()\u3057\u3066\u4e2d\u8eab\u3092\u8868\u793a\u3059\u308b\u306e\u3068\u9055\u3044\u304c\u306a\u3044\u3088\u3046\u306b\u601d\u3044\u307e\u3059\u3051\u3069\u3001\u5b9f\u306f\u3053\u306edd()\u306b\u306f\u3082\u3046\u4e00\u3064\u4fbf\u5229\u306a\u4f7f\u3044\u65b9\u304c\u3042\u308b\u3093\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3092\u307f\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u70b9\u6570\u304c\u5165\u3063\u305f\u30c7\u30fc\u30bf\u304c\u3042\u3063\u3066\u3001\u3055\u3089\u306b\u3059\u3079\u3066\u306e\u70b9\u6570\u306b\uff11\u3092\u8db3\u3059\u5834\u5408\u306f\u3001map()\u3092\u4f7f\u3048\u3070\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$collection = collect([\r\n    ['name' =&gt; '\u5c71\u7530', 'score' =&gt; 10],\r\n    ['name' =&gt; '\u9234\u6728', 'score' =&gt; 8],\r\n    ['name' =&gt; '\u4f50\u85e4', 'score' =&gt; 3],\r\n    ['name' =&gt; '\u7530\u4e2d', 'score' =&gt; 7],\r\n    ['name' =&gt; '\u5c71\u672c', 'score' =&gt; 9]\r\n])\r\n-&gt;map(function($item, $key){\r\n\r\n    <strong>$item['score'] += 1;<\/strong>\r\n    return $item;\r\n\r\n});<\/pre>\n<p>\u3067\u3001\u3055\u3089\u306b\uff11\uff10\u3092\u8db3\u3059\u5834\u5408\u306f\u3001\u3053\u3093\u306a\u98a8\u306b\u65b0\u3057\u3044map\u3092\u6570\u73e0\u3064\u306a\u304e\u3067\u8ffd\u52a0\u3059\u308c\u3070\u3044\u3044\u308f\u3051\u3067\u3059\u3088\u306d\u3002<\/p>\n<pre>$collection = collect([\r\n    ['name' =&gt; '\u5c71\u7530', 'score' =&gt; 10],\r\n    ['name' =&gt; '\u9234\u6728', 'score' =&gt; 8],\r\n    ['name' =&gt; '\u4f50\u85e4', 'score' =&gt; 3],\r\n    ['name' =&gt; '\u7530\u4e2d', 'score' =&gt; 7],\r\n    ['name' =&gt; '\u5c71\u672c', 'score' =&gt; 9]\r\n])\r\n-&gt;map(function($item, $key){\r\n\r\n    <strong>$item['score'] += 1;<\/strong>\r\n    return $item;\r\n\r\n})\r\n-&gt;map(function($item, $key){\r\n\r\n    <strong>$item['score'] += 10;<\/strong>\r\n    return $item;\r\n\r\n});<\/pre>\n<p>\u3067\u306f\u3001\u3053\u306e\u72b6\u614b\u3067\uff11\u3092\u8db3\u3057\u305f\u76f4\u5f8c\u306e\u30c7\u30fc\u30bf\u3092\u78ba\u8a8d\u3057\u305f\u304f\u306a\u3063\u305f\u3089\u3069\u3046\u3067\u3057\u3087\u3046\u304b\uff1f\uff1f\u304a\u305d\u3089\u304f\u3001\u6700\u5f8c\u306emap()\u3092\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3059\u308b\u306a\u3069\u3057\u3066dd();\u3092\u5b9f\u884c\u3057\u305f\u308a\u3059\u308b\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u3067\u3082\u3001dd()\u306f\u305d\u3093\u306a\u9762\u5012\u306a\u3053\u3068\u3092\u3057\u306a\u304f\u3066\u3082\u3001\u3053\u3046\u3059\u308c\u3070\u9014\u4e2d\u306e\u4e2d\u8eab\u3092\u8868\u793a\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<pre>$collection = collect([\r\n    ['name' =&gt; '\u5c71\u7530', 'score' =&gt; 10],\r\n    ['name' =&gt; '\u9234\u6728', 'score' =&gt; 8],\r\n    ['name' =&gt; '\u4f50\u85e4', 'score' =&gt; 3],\r\n    ['name' =&gt; '\u7530\u4e2d', 'score' =&gt; 7],\r\n    ['name' =&gt; '\u5c71\u672c', 'score' =&gt; 9]\r\n])\r\n-&gt;map(function($item, $key){\r\n\r\n    $item['score'] += 1;\r\n    return $item;\r\n\r\n})\r\n<strong>-&gt;dd() \/\/ \u4e2d\u8eab\u3092\u8868\u793a\uff08\u3053\u3053\u3067\u51e6\u7406\u304c\u3068\u307e\u308b\uff09<\/strong>\r\n-&gt;map(function($item, $key){\r\n\r\n    $item['score'] += 1;\r\n    return $item;\r\n\r\n});<\/pre>\n<p>\u3064\u307e\u308a\u3001\u5143\u306e\u30b3\u30fc\u30c9\u3092\u5d29\u3055\u306a\u304f\u3066\u3082\u4e2d\u8eab\u3092\u30c1\u30a7\u30c3\u30af\u3067\u304d\u308b\u306e\u3067\u3001\u958b\u767a\u3059\u308b\u5074\u304b\u3089\u3059\u308b\u3068\u3068\u3066\u3082\u4fbf\u5229\u306a\u30e1\u30bd\u30c3\u30c9\u306b\u306a\u3063\u3066\u307e\u3059\u3002<\/p>\n<p>\u203b\u3061\u306a\u307f\u306b\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u3092echo\u3057\u305f\u3068\u304d\u3069\u3046\u306a\u308b\u304b\u77e5\u3063\u3066\u307e\u3059\u304b\uff1f\uff1f\u5b9f\u306f\u3001\u30a8\u30e9\u30fc\u306b\u306f\u306a\u3089\u305a\u3001json\u306b\u306a\u3063\u3066\u4e2d\u8eab\u3092\u8868\u793a\u3057\u3066\u304f\u308c\u307e\u3059\u3002\u3053\u306e\u8fba\u3082\u5b09\u3057\u3044\u3067\u3059\u306d\u3002<\/p>\n<h1>pluck()\u3000\u30ad\u30fc\u3092\u6307\u5b9a\u3057\u3066\u307b\u3057\u3044\u30c7\u30fc\u30bf\u3060\u3051\u53d6\u5f97\u3059\u308b<\/h1>\n<p>pluck\u306f\u30b7\u30f3\u30d7\u30eb\u3067\u3059\u3051\u3069\u3068\u3066\u3082\u4fbf\u5229\u306a\u30e1\u30bd\u30c3\u30c9\u3067\u3001\u6307\u5b9a\u3057\u305f\u30ad\u30fc\u306e\u30c7\u30fc\u30bf\u3060\u3051\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001ID\u304c\u5165\u3063\u305f\u30e6\u30fc\u30b6\u30fc\u30c7\u30fc\u30bf\u304c\u3042\u3063\u305f\u3068\u3057\u307e\u3059\u3002<\/p>\n<pre>$collection = collect([\r\n    [<strong>'id' =&gt; 1<\/strong>, 'name' =&gt; '\u5c71\u7530'],\r\n    [<strong>'id' =&gt; 2<\/strong>, 'name' =&gt; '\u9234\u6728'],\r\n    [<strong>'id' =&gt; 5<\/strong>, 'name' =&gt; '\u4f50\u85e4'],\r\n    [<strong>'id' =&gt; 7<\/strong>, 'name' =&gt; '\u7530\u4e2d'],\r\n    [<strong>'id' =&gt; 8<\/strong>, 'name' =&gt; '\u5c71\u672c']\r\n]);<\/pre>\n<p>\u3082\u3057\u3053\u306e\u30c7\u30fc\u30bf\u3092\u3001<\/p>\n<ul>\n<li><strong>\u30ad\u30fc\u304cID<\/strong><\/li>\n<li><strong>\u5024\u304cname<\/strong><\/li>\n<\/ul>\n<p>\u306e\u9023\u60f3\u914d\u5217\u306b\u3057\u305f\u3044\u5834\u5408\u3001<strong>pluck()<\/strong>\u3092\u4f7f\u3063\u3066\u697d\u306b\u5b9f\u73fe\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>$filtered = $collection-&gt;<strong>pluck('name', 'id')<\/strong>;<\/pre>\n<p>\u7d50\u679c\u306f\u3001\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$results = [\r\n    1 =&gt; '\u5c71\u7530',\r\n    2 =&gt; '\u9234\u6728',\r\n    5 =&gt; '\u4f50\u85e4',\r\n    7 =&gt; '\u7530\u4e2d',\r\n    8 =&gt; '\u5c71\u672c'\r\n];<\/pre>\n<p>\u3082\u3057\u540d\u524d\u3092\u901a\u5e38\u306e\u914d\u5217\u3067\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u306f\u3001name\u3060\u3051\u3092\u6307\u5b9a\u3059\u308c\u3070OK\u3067\u3059\u3002<\/p>\n<pre>$filtered = $collection-&gt;<strong>pluck('name')<\/strong>;<\/pre>\n<p>\u7d50\u679c\u306f\u3053\u3046\u3067\u3059\u3002<\/p>\n<pre>$results = [\r\n    <strong>0<\/strong> =&gt; '\u5c71\u7530',\r\n    <strong>1<\/strong> =&gt; '\u9234\u6728',\r\n    <strong>2<\/strong> =&gt; '\u4f50\u85e4',\r\n    <strong>3<\/strong> =&gt; '\u7530\u4e2d',\r\n    <strong>4<\/strong> =&gt; '\u5c71\u672c'\r\n];<\/pre>\n<h1>\u3061\u306a\u307f\u306b\u3001\u72ec\u81ea\u306e\u30e1\u30bd\u30c3\u30c9\u3082\u4f5c\u308c\u3061\u3083\u3046\uff01<\/h1>\n<p>Laravel\u306f\u72ec\u81ea\u306e\u25cb\u25cb\u3092\u4f5c\u308b\u3068\u3044\u3046\u306e\u304c\u3001\u7279\u5fb4\u306e\u3072\u3068\u3064\u3060\u3063\u305f\u308a\u3082\u3057\u3066\u3044\u3066\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u3067\u3082\u72ec\u81ea\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u4f5c\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u958b\u767a\u3092\u3057\u3066\u3044\u308b\u3068\u7d50\u69cb\u300c\u3042\u308b\u3042\u308b\u300d\u3060\u3068\u601d\u3046\u3093\u3067\u3059\u3051\u3069\u3001\u6570\u5b57\u3092\uff13\u6841\u30ab\u30f3\u30de\u5f62\u5f0f\u306b\u3057\u305f\u3044\u5834\u5408\u3067\u3059\u3002\u3082\u3061\u308d\u3093\u3044\u3061\u3044\u3061number_format()\u3059\u308c\u3070\u3044\u3044\u8a71\u306a\u3093\u3067\u3059\u3051\u3069\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u3067\u3088\u304f\u4f7f\u3046\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u72ec\u81ea\u30e1\u30bd\u30c3\u30c9\u3092\u767b\u9332\u3057\u3066\u304a\u304f\u3068\u3044\u3064\u3067\u3082\u547c\u3073\u51fa\u305b\u3066\u4fbf\u5229\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre>Collection::<strong>macro<\/strong>('number_format', function () {\r\n\r\n    return $this-&gt;map(function ($value) {\r\n\r\n        return <strong>number_format($value)<\/strong>;\r\n\r\n    });\r\n\r\n});<\/pre>\n<p>\u72ec\u81ea\u30e1\u30bd\u30c3\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u306b\u306f\u3001macro()\u3092\u4f7f\u3044\u307e\u3059\u3002<br \/>\n\u3084\u3063\u3066\u3044\u308b\u306e\u306f\u3001\u4e2d\u8eab\u3067map()\u3092\u4f7f\u3063\u3066\u5168\u8981\u7d20\u306bnumber_format()\u3067\u30c7\u30fc\u30bf\u52a0\u5de5\u3057\u3066\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<p>\u4f7f\u3044\u65b9\u306f\u3053\u3046\u3067\u3059\u3002<\/p>\n<pre>$collection = collect([100000, 200000, 1500000]);\r\n$numbers = $collection-&gt;<strong>number_format()<\/strong>;<\/pre>\n<p>\u3061\u306a\u307f\u306b\u3001Collection\u306enamespace\u5ba3\u8a00\u3092\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<pre>use Illuminate\\Support\\Collection;<\/pre>\n<p>\u307e\u305f\u3001\u3069\u3053\u304b\u3089\u3067\u3082\u547c\u3073\u51fa\u3059\u305f\u3081\u306b\u3001\u3053\u306e\u72ec\u81ea\u30e1\u30bd\u30c3\u30c9\u306e\u5b9a\u7fa9\u306f<strong>app\/Providers\/AppServiceProvider.php<\/strong>\u306eboot()\u306b\u3067\u3082\u5165\u308c\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3053\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u4f7f\u3048\u3070\u3001\u4f1a\u793e\u72ec\u81ea\u306e\u8acb\u6c42\u66f8\u756a\u53f7\u3092\u4f5c\u3063\u305f\u308a\u3059\u308b\u306e\u3082\u697d\u306b\u3044\u3051\u308b\u3068\u601d\u3044\u307e\u3059\u3002\uff08\u50d5\u306e\u5834\u5408\u306faccessor\u3092\u3088\u304f\u4f7f\u3044\u307e\u3059\u3051\u3069\u306d ^^\uff09<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u50d5\u304c\u304a\u3059\u3059\u3081\u3059\u308b\uff08\u5b9f\u969b\u3088\u304f\u4f7f\u3046\uff09\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30fb\u30e1\u30bd\u30c3\u30c9\uff17\u3064\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u3044\u304b\u304c\u3060\u3063\u305f\u3067\u3057\u3087\u3046\u304b\uff1f\uff1f<\/p>\n<p>\u3051\u3063\u3053\u3046\u5b9a\u756a\u3082\u306e\u304c\u591a\u304f\u306a\u3063\u3061\u3083\u3063\u305f\u306a\u30fc\u3063\u3066\u601d\u3063\u3066\u308b\u3093\u3067\u3001\u3082\u3057\u300c\u305d\u3093\u306a\u306e\u77e5\u3063\u3066\u308b\u3088\uff01\u300d\u72b6\u614b\u306b\u306a\u3063\u3061\u3083\u3063\u3066\u305f\u3089\u30b4\u30e1\u30f3\u30ca\u30b5\u30a4\u3002m_ _m<\/p>\n<p>\u3042\u3068\u3001\u3053\u308c\u3082\u3061\u306a\u307f\u306b\u3067\u3059\u3051\u3069\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u30e1\u30bd\u30c3\u30c9\u540d\u3092\u898b\u3066\u308b\u3068 <a href=\"https:\/\/lodash.com\" target=\"_blank\" rel=\"noopener\">lodash.js<\/a>\u3068\u540c\u3058\u3082\u306e\u304c\u591a\u3044\u306e\u3067\u3001\u304a\u305d\u3089\u304f\u3053\u3053\u304b\u3089\u5f71\u97ff\u3092\u53d7\u3051\u305f\u3093\u3060\u308d\u3046\u306a\u30fc\u3063\u3066\u52dd\u624b\u306b\u601d\u3063\u3066\u307e\u3059\u3002Laravel\u306e\u305d\u3046\u3044\u3046\u5438\u53ce\u529b\u306e\u9ad8\u3044\u3068\u3053\u308d\u3082\u3044\u3044\u3067\u3059\u306d\uff01\uff08\u3066\u304b\u3001lodash\u304c\u5148\u3067\u3042\u3063\u3066\u307e\u3059\u3088\u306d\uff1f\uff1f\uff09<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-444 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/16.png\" alt=\"\" width=\"370\" height=\"310\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/16.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/16-300x251.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u3053\u306e\u3068\u3053\u308dLaravel\u95a2\u9023\u306e\u8a18\u4e8b\u306b\u30a2\u30af\u30bb\u30b9\u304c\u591a\u304f\u306a\u3063\u3066\u304d\u3066\u3044\u308b\u3088\u3046\u3067\u3001\u30c9\u7d20\u4eba\u306e\u6587\u7ae0\u306a\u304c\u3089\u8aad\u3093\u3067\u304f\u308c\u3066\u3044\u308b\u4eba\u305f\u3061\u306b\u611f\u8b1d\u3057\u3066\u3044\u308b\u4eca\u65e5\u3053\u306e\u9803\u3067\u3059\u3002m_  &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=493\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel\u306e\u4fbf\u5229\u306a\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30fb\u30e1\u30bd\u30c3\u30c9\uff17\u9078\uff01&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":503,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[65],"class_list":["post-493","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","tag-65"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/493","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=493"}],"version-history":[{"count":7,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/493\/revisions"}],"predecessor-version":[{"id":502,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/493\/revisions\/502"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/503"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=493"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=493"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}