{"id":9322,"date":"2021-07-19T07:00:33","date_gmt":"2021-07-18T22:00:33","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=9322"},"modified":"2021-06-27T03:29:47","modified_gmt":"2021-06-26T18:29:47","slug":"laravel-%e3%81%a7%e3%80%8c%e5%a5%bd%e3%81%8d%e3%81%aa%e8%8a%b8%e4%ba%ba%e3%81%8c%e4%bc%bc%e3%81%a6%e3%82%8b%e3%80%8d%e3%83%9e%e3%83%83%e3%83%81%e3%83%b3%e3%82%b0%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=9322","title":{"rendered":"Laravel \u3067\u300c\u597d\u304d\u306a\u82b8\u4eba\u304c\u4f3c\u3066\u308b\u300d\u30de\u30c3\u30c1\u30f3\u30b0\u30b7\u30b9\u30c6\u30e0\u3092\u3064\u304f\u3063\u3066\u307f\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u5fd9\u3057\u3044\u306a\u304c\u3089\u3082\u65e9\u3044\u4e16\u306e\u4e2d\u306e\u6d41\u308c\u306b\u53d6\u308a\u6b8b\u3055\u308c\u306a\u3044\u3088\u3046\u3001\u3044\u308d\u3044\u308d\u60c5\u5831\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u4e2d\u3067\u3082\u500b\u4eba\u7684\u306b\u597d\u304d\u306a\u306e\u304c\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">\uff08\u30b7\u30b9\u30c6\u30e0\u958b\u767a\u306e\uff09\u6c42\u4eba\u60c5\u5831\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b<\/strong><\/p>\n<p>\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u3068\u3044\u3046\u306e\u3082\u3001\u6c42\u4eba\u60c5\u5831\u306b\u4e0a\u304c\u3063\u3066\u304f\u308b\u30ad\u30fc\u30ef\u30fc\u30c9\u306f\u300c<strong>\u6642\u4ee3\u3092\u53cd\u6620\u3057\u305f\u3082\u306e<\/strong>\u300d\u304c\u591a\u3044\u3067\u3059\u3057\u3001\u305f\u307e\u306b\u300c\u3048\u3063\u3001\u305d\u3093\u306a\u3082\u306e\u304c\u3042\u308b\u306e\uff01\uff1f\u300d\u3068\u3001<strong>\u5168\u304f\u77e5\u3089\u306a\u3044\u30c6\u30af\u30ce\u30ed\u30b8\u30fc\u3092\u77e5\u308b\u304d\u3063\u304b\u3051\u306b\u3082\u306a\u308b<\/strong>\u306e\u3067\u3001\uff08\u305f\u3068\u3048\u6c42\u8077\u8005\u3067\u306a\u304f\u3066\u3082\uff09\u30c1\u30a7\u30c3\u30af\u3057\u3066\u304a\u304f\u306e\u306f\u304d\u3063\u3068\u6709\u76ca\u3060\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u3053\u306e\u9593\u3082\u3044\u308d\u3044\u308d\u3068\u898b\u3066\u3044\u3066\u6bd4\u8f03\u7684\u6570\u304c\u591a\u3044\u6c42\u4eba\u5185\u5bb9\u3060\u3063\u305f\u306e\u304c\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">\u30de\u30c3\u30c1\u30f3\u30b0\u30b5\u30fc\u30d3\u30b9\u306e\u958b\u767a<\/strong><\/p>\n<p>\u3067\u3057\u305f\u3002<\/p>\n<p>\u304a\u305d\u3089\u304f\u30b3\u30ed\u30ca\u798d\u306e\u3054\u6642\u4e16\u3067\u3059\u304b\u3089\u3001\u3042\u307e\u308a\u5916\u306b\u51fa\u306b\u304f\u3044\u306e\u3067\u30de\u30c3\u30c1\u30f3\u30b0\u30b5\u30fc\u30d3\u30b9\u3067\u53cb\u9054\u3084\u604b\u4eba\u3092\u63a2\u305d\u3046\u3068\u3044\u3046\u30cb\u30fc\u30ba\u304c\u591a\u3044\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u3053\u3067\u2757<\/p>\n<p>\u4eca\u56de\u306f<code>Laravel<\/code>\u3092\u4f7f\u3063\u3066\u300c<strong>\u8da3\u5473\u304c\u5408\u3046\u4eba<\/strong>\u300d\u3092\u30de\u30c3\u30c1\u30f3\u30b0\u3059\u308b\u30b7\u30b9\u30c6\u30e0\u3092\u4f5c\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3001\u300c\u666e\u901a\u306e\u8da3\u5473\u300d\u3067\u306f\u500b\u4eba\u7684\u306b\u30e2\u30c1\u30d9\u30fc\u30b7\u30e7\u30f3\u304c\u3042\u304c\u3089\u306a\u3044\u306e\u3067\u3001\u300c<strong>M-1\u30b0\u30e9\u30f3\u30d7\u30ea\u3067\u512a\u52dd\u3057\u305f\u82b8\u4eba\u3055\u3093\u3067\u8ab0\u304c\u597d\u304d\u304b<\/strong>\u300d\u3067\u30de\u30c3\u30c1\u30f3\u30b0\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u4f55\u304b\u306e\u53c2\u8003\u306b\u306a\u308a\u307e\u3057\u305f\u3089\u5b09\u3057\u3044\u3067\u3059\u3002\ud83d\ude0a\u2728<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3405 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18.png\" alt=\"\" width=\"310\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18.png 310w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18-291x300.png 291w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/>\u300c\u512a\u52dd\u306f\u9003\u3057\u307e\u3057\u305f\u304c\u3001<br \/>\n\u6700\u8fd1\u3060\u3068\u304a\u3044\u3067\u3084\u3059\u3053\u304c<br \/>\n\u3055\u3093\u304c\u597d\u304d\u3067\u3059\ud83d\udc4d\u300d<\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 8.x<\/p>\n<h1><span id=\"i\">\u524d\u63d0\u3068\u3057\u3066<\/span><\/h1>\n<p>\u300c<strong>\u8ab0<\/strong>\u300d\u3068\u300c<strong>\u8ab0<\/strong>\u300d\u3092\u30de\u30c3\u30c1\u30f3\u30b0\u3055\u305b\u308b\u304b\u3068\u3044\u3046\u8a71\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3001\u30c6\u30b9\u30c8\u30e6\u30fc\u30b6\u30fc\u304c<code>users<\/code>\u30c6\u30fc\u30d6\u30eb\u306b\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u524d\u63d0\u3067\u3059\u3002<\/p>\n<p>\u3082\u3057\u307e\u3060\u306e\u65b9\u306f\u4ee5\u4e0b\u3092\u53c2\u8003\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>\ud83d\udcdd\u00a0\u53c2\u8003\u30da\u30fc\u30b8<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/blog.capilano-fw.com\/?p=8301\">Laravel Breeze\u3067\u300c\u30b7\u30f3\u30d7\u30eb\u306a\u300d\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><\/li>\n<li><a href=\"https:\/\/blog.capilano-fw.com\/?p=7827\">Laravel8.x\u4ee5\u964d\u3067\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5<\/a><\/li>\n<\/ul>\n<p>\u5b9f\u969b\u306e\u30c6\u30fc\u30d6\u30eb\u306f\u3053\u3061\u3089<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9125\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/05\/analyze_order_patterns_1.png\" alt=\"\" width=\"538\" height=\"463\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/05\/analyze_order_patterns_1.png 538w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/05\/analyze_order_patterns_1-300x258.png 300w\" sizes=\"auto, (max-width: 538px) 100vw, 538px\" \/><\/p>\n<h1>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\uff06\u30e2\u30c7\u30eb\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u307e\u305a\u521d\u3081\u306b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5468\u308a\u304b\u3089\u6e96\u5099\u3057\u3066\u3044\u304d\u307e\u3059\u304c\u3001\u4eca\u56de\u5fc5\u8981\u306b\u306a\u308b\u306e\u306f\u4ee5\u4e0b\uff13\u3064\u306e\u30c6\u30fc\u30d6\u30eb\u3067\u3059\u3002<\/p>\n<ul>\n<li>users\uff1a \u30de\u30c3\u30c1\u30f3\u30b0\u3059\u308b\u30e6\u30fc\u30b6\u30fc<\/li>\n<li>comedians\uff1a M-1\u30b0\u30e9\u30f3\u30d7\u30ea\u512a\u52dd\u3057\u305f\u82b8\u4eba\u3055\u3093<\/li>\n<li>user_comedians\uff1a \u300c\u8ab0\u304c\u3069\u306e\u82b8\u4eba\u3055\u3093\u3092\u597d\u304d\u304b\u300d\u3092\u7ba1\u7406\u3059\u308b\u4e2d\u9593\u30c6\u30fc\u30d6\u30eb<\/li>\n<\/ul>\n<p>\u3067\u306f\u3001\uff08\u3059\u3067\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u306e<code>users<\/code>\u4ee5\u5916\u306e\uff09\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\uff06\u30e2\u30c7\u30eb\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:model Comedian -m<\/strong><\/pre>\n<pre><strong>php artisan make:model UserComedian -m<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u30d5\u30a1\u30a4\u30eb\u304c\u81ea\u52d5\u7684\u306b\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u4e2d\u8eab\u3092\u305d\u308c\u305e\u308c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p><strong>database\/migrations\/****_**_**_******_create_comedians_table.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function up()\r\n{\r\n    Schema::create('comedians', function (Blueprint $table) {\r\n        $table-&gt;id();\r\n        <strong>$table-&gt;string('name')-&gt;comment('\u30b3\u30f3\u30d3\u540d');<\/strong>\r\n        $table-&gt;timestamps();\r\n    });\r\n}<\/pre>\n<p>\u305d\u3057\u3066\u3001\u4e2d\u9593\u30c6\u30fc\u30d6\u30eb\u3082\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>database\/migrations\/****_**_**_******_create_user_comedians_table.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function up()\r\n{\r\n    Schema::create('user_comedians', function (Blueprint $table) {\r\n        $table-&gt;id();\r\n        <strong>$table-&gt;unsignedBigInteger('user_id')-&gt;comment('\u30e6\u30fc\u30b6\u30fcID');<\/strong>\r\n<strong>        $table-&gt;unsignedBigInteger('comedian_id')-&gt;comment('\u82b8\u4eba\u3055\u3093ID');<\/strong>\r\n        $table-&gt;timestamps();\r\n\r\n        \/\/ \u5916\u90e8\u30ad\u30fc\r\n        <strong>$table-&gt;foreign('user_id')-&gt;references('id')-&gt;on('users');<\/strong>\r\n<strong>        $table-&gt;foreign('comedian_id')-&gt;references('id')-&gt;on('comedians');<\/strong>\r\n    });\r\n}<\/pre>\n<p>\u6b21\u306b\u30e2\u30c7\u30eb\u306e\u4e2d\u8eab\u3082\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p><strong>app\/Models\/User.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\nclass User extends Authenticatable\r\n{\r\n    \/\/ \u7701\u7565\r\n    \r\n    \/\/ Relationship\r\n    public function comedians()\r\n    {\r\n        <strong>return $this-&gt;belongsToMany(<\/strong>\r\n<strong>            Comedian::class,    \/\/ \u7d50\u5408\u3057\u305f\u3044\u30e2\u30c7\u30eb<\/strong>\r\n<strong>            'user_comedians',   \/\/ \u4e2d\u9593\u30c6\u30fc\u30d6\u30eb\u540d<\/strong>\r\n<strong>            'user_id',          \/\/ \u81ea\u5206\u81ea\u8eab\uff08User\u30e2\u30c7\u30eb\uff09\u306b\u5bfe\u5fdc\u3059\u308b\uff08\u4e2d\u9593\u30c6\u30fc\u30d6\u30eb\u306e\uff09\u30d5\u30a3\u30fc\u30eb\u30c9<\/strong>\r\n<strong>            'comedian_id'       \/\/ \u53d6\u5f97\u3057\u305f\u3044\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u5fdc\u3059\u308b\uff08\u4e2d\u9593\u30c6\u30fc\u30d6\u30eb\u306e\uff09\u30d5\u30a3\u30fc\u30eb\u30c9<\/strong>\r\n<strong>        )-&gt;orderBy('id', 'asc');<\/strong>\r\n    }\r\n}<\/pre>\n<p>\u3053\u306e\u4e2d\u306e<code>belongsToMany()<\/code>\u306f\u3001\u3044\u308f\u3086\u308b\u300c<strong>\u591a\uff1a\u591a<\/strong>\u300d\uff08Many to Many\uff09\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u306b\u3059\u308b\u305f\u3081\u306e\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u4e2d\u9593\u30c6\u30fc\u30d6\u30eb\u306b\u95a2\u3057\u3066\u306f\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>\ud83d\udcdd \u53c2\u8003\u30da\u30fc\u30b8\uff1a<\/strong> <a href=\"https:\/\/blog.capilano-fw.com\/?p=7407#i-5\" target=\"_blank\" rel=\"noopener\">\u4e2d\u9593\u30c6\u30fc\u30d6\u30eb\u306e\u8003\u3048\u65b9<\/a><\/p>\n<h1>\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u3064\u304f\u308b<\/h1>\n<p>\u7d9a\u3044\u3066\u3001\u958b\u767a\u304c\u3057\u3084\u3059\u3044\u3088\u3046\u306b<code>Seeder<\/code>\u3067\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u3064\u304f\u308a\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:seed ComedianSeeder<\/strong><\/pre>\n<pre><strong>php artisan make:seed UserComedianSeeder<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u30d5\u30a1\u30a4\u30eb\u304c\uff12\u3064\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u305d\u308c\u305e\u308c\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p><strong>database\/seeders\/ComedianSeeder.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace Database\\Seeders;\r\n\r\n<strong>use App\\Models\\Comedian;<\/strong>\r\nuse Illuminate\\Database\\Seeder;\r\n\r\nclass ComedianSeeder extends Seeder\r\n{\r\n    \/**\r\n     * Run the database seeds.\r\n     *\r\n     * @return void\r\n     *\/\r\n    <strong>public function run()<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $comedian_names = [<\/strong>\r\n<strong>            '\u4e2d\u5ddd\u5bb6',<\/strong>\r\n<strong>            '\u307e\u3059\u3060\u304a\u304b\u3060',<\/strong>\r\n<strong>            '\u30d5\u30c3\u30c8\u30dc\u30fc\u30eb\u30a2\u30ef\u30fc',<\/strong>\r\n<strong>            '\u30a2\u30f3\u30bf\u30c3\u30c1\u30e3\u30d6\u30eb',<\/strong>\r\n<strong>            '\u30d6\u30e9\u30c3\u30af\u30de\u30e8\u30cd\u30fc\u30ba',<\/strong>\r\n<strong>            '\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb',<\/strong>\r\n<strong>            '\u30b5\u30f3\u30c9\u30a6\u30a3\u30c3\u30c1\u30de\u30f3',<\/strong>\r\n<strong>            'NON STYLE',<\/strong>\r\n<strong>            '\u30d1\u30f3\u30af\u30d6\u30fc\u30d6\u30fc',<\/strong>\r\n<strong>            '\u7b11\u3044\u98ef',<\/strong>\r\n<strong>            '\u30c8\u30ec\u30f3\u30c7\u30a3\u30a8\u30f3\u30b8\u30a7\u30eb',<\/strong>\r\n<strong>            '\u9280\u30b7\u30e3\u30ea',<\/strong>\r\n<strong>            '\u3068\u308d\u30b5\u30fc\u30e2\u30f3',<\/strong>\r\n<strong>            '\u971c\u964d\u308a\u660e\u661f',<\/strong>\r\n<strong>            '\u30df\u30eb\u30af\u30dc\u30fc\u30a4',<\/strong>\r\n<strong>            '\u30de\u30c2\u30ab\u30eb\u30e9\u30d6\u30ea\u30fc',<\/strong>\r\n<strong>        ];<\/strong>\r\n\r\n<strong>        foreach ($comedian_names as $comedian_name) {<\/strong>\r\n\r\n<strong>            $comedian = new Comedian();<\/strong>\r\n<strong>            $comedian-&gt;name = $comedian_name;<\/strong>\r\n<strong>            $comedian-&gt;save();<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u203b \u656c\u79f0\u306f\u7701\u7565\u3055\u305b\u3066\u3044\u305f\u3060\u3044\u3066\u304a\u308a\u307e\u3059\u304c\u3001\u4e16\u306e\u4e2d\u3092\u660e\u308b\u304f\u3057\u3066\u304f\u308c\u308b\u82b8\u4eba\u3055\u3093\u305f\u3061\u3092\u5c0a\u656c\u3057\u3066\u304a\u308a\u307e\u3059\u3002m(_ _)m<\/p>\n<pre>&lt;?php\r\n\r\nnamespace Database\\Seeders;\r\n\r\n<strong>use App\\Models\\Comedian;<\/strong>\r\n<strong>use App\\Models\\User;<\/strong>\r\n<strong>use App\\Models\\UserComedian;<\/strong>\r\nuse Illuminate\\Database\\Seeder;\r\n\r\nclass UserComedianSeeder extends Seeder\r\n{\r\n    \/**\r\n     * Run the database seeds.\r\n     *\r\n     * @return void\r\n     *\/\r\n    <strong>public function run()<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $users = User::get();<\/strong>\r\n<strong>        $comedians = Comedian::get();<\/strong>\r\n\r\n<strong>        foreach ($users as $user) {<\/strong>\r\n\r\n<strong>            $count = rand(3, 5);<\/strong>\r\n<strong>            $random_comedians = $comedians-&gt;shuffle()-&gt;slice(0, $count);   \/\/ \u30e9\u30f3\u30c0\u30e0\u3067\uff13\u301c\uff15\u4ef6\u306e\u82b8\u4eba\u3055\u3093\u3092\u53d6\u5f97<\/strong>\r\n\r\n<strong>            foreach ($random_comedians as $random_comedian) {<\/strong>\r\n\r\n<strong>                $user_comedian = new UserComedian();<\/strong>\r\n<strong>                $user_comedian-&gt;user_id = $user-&gt;id;<\/strong>\r\n<strong>                $user_comedian-&gt;comedian_id = $random_comedian-&gt;id;<\/strong>\r\n<strong>                $user_comedian-&gt;save();<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u3067\u306f\u3001<code>Seeder<\/code>\u30d5\u30a1\u30a4\u30eb\u3092<code>Laravel<\/code>\u3078\u767b\u9332\u3057\u3066\u6709\u52b9\u306b\u3057\u307e\u3059\u3002<\/p>\n<p><strong>database\/seeders\/DatabaseSeeder.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace Database\\Seeders;\r\n\r\nuse Illuminate\\Database\\Seeder;\r\n\r\nclass DatabaseSeeder extends Seeder\r\n{\r\n    \/**\r\n     * Seed the application's database.\r\n     *\r\n     * @return void\r\n     *\/\r\n    public function run()\r\n    {\r\n        \/\/ \u7701\u7565\r\n<strong>        $this-&gt;call(ComedianSeeder::class);      \/\/ \ud83d\udc48 \u3053\u3053\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f <\/strong>\r\n<strong>        $this-&gt;call(UserComedianSeeder::class);  \/\/ \ud83d\udc48 \u3053\u3053\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f <\/strong>\r\n    }\r\n}<\/pre>\n<p>\u3067\u306f\u3001\u3053\u306e\u72b6\u614b\u3067DB\u30c6\u30fc\u30d6\u30eb\u3092\u518d\u69cb\u7bc9\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan migrate:fresh --seed<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u5b9f\u969b\u306e\u30c6\u30fc\u30d6\u30eb\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9326\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_matching_2.png\" alt=\"\" width=\"271\" height=\"653\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_matching_2.png 271w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_matching_2-125x300.png 125w\" sizes=\"auto, (max-width: 271px) 100vw, 271px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9329\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_matching_1.png\" alt=\"\" width=\"411\" height=\"430\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_matching_1.png 411w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_matching_1-287x300.png 287w\" sizes=\"auto, (max-width: 411px) 100vw, 411px\" \/><\/p>\n<h1>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u3053\u3053\u304b\u3089\u306f\u300c<strong>\u597d\u304d\u306a\u82b8\u4eba\u304c\u4f3c\u3066\u308b<\/strong>\u300d\u4eba\u3092\u4e00\u89a7\u8868\u793a\u3059\u308b\u90e8\u5206\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f5c\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:controller MatchingController<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u4e2d\u8eab\u3092\u6b21\u306e\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>app\/Http\/Controllers\/MatchingController.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\n<strong>use App\\Models\\User;<\/strong>\r\nuse Illuminate\\Http\\Request;\r\n\r\nclass MatchingController extends Controller\r\n{\r\n    <strong>const MIN_MATCHING_COUNT = 1;<\/strong>\r\n\r\n<strong>    public function show(User $user)<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $comedian_ids = $user-&gt;comedians-&gt;pluck('id');<\/strong>\r\n<strong>        $matched_users = User::with(['comedians' =&gt; function($query) use($comedian_ids){ \/\/ \ud83d\udc48 \u540c\u3058\u300c\u597d\u304d\u306a\u82b8\u4eba\u3055\u3093\u300d\u3092\u53d6\u5f97<\/strong>\r\n\r\n<strong>            $query-&gt;whereIn('comedian_id', $comedian_ids);<\/strong>\r\n\r\n<strong>        }])<\/strong>\r\n<strong>        -&gt;where('id', '!=', $user-&gt;id)  \/\/ \ud83d\udc48 \u81ea\u5206\u4ee5\u5916\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97<\/strong>\r\n<strong>        -&gt;get()<\/strong>\r\n<strong>        -&gt;filter(function($matched_user){ \/\/ \ud83d\udc48 \u6700\u4f4e\u3067\u3082 `MIN_MATCHING_COUNT` \u4ee5\u4e0a\u30de\u30c3\u30c1\u3059\u308b\u3082\u306e\u3060\u3051<\/strong>\r\n\r\n<strong>            return ($matched_user-&gt;comedians-&gt;count() &gt;= self::MIN_MATCHING_COUNT);<\/strong>\r\n\r\n<strong>        })<\/strong>\r\n<strong>        -&gt;sortByDesc(function($matched_user) { \/\/ \ud83d\udc48 \u30de\u30c3\u30c1\u3057\u305f\u82b8\u4eba\u3055\u3093\u306e\u6570\u3067\u4e26\u3079\u66ff\u3048\uff08\u964d\u9806\uff09<\/strong>\r\n\r\n<strong>            return $matched_user-&gt;comedians-&gt;count();<\/strong>\r\n\r\n<strong>        });<\/strong>\r\n\r\n<strong>        return view('matching')-&gt;with([<\/strong>\r\n<strong>            'user' =&gt; $user,<\/strong>\r\n<strong>            'matched_users' =&gt; $matched_users<\/strong>\r\n<strong>        ]);<\/strong>\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u4eca\u56de\u306e\u958b\u767a\u3067\u4e00\u756a\u8907\u96d1\u306a\u306e\u304c\u3053\u306e<code>show()<\/code>\u3067\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p>\u307e\u305a\u5927\u304d\u304f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\uff12\u3064\u306e\u30d6\u30ed\u30c3\u30af\u306b\u5206\u304b\u308c\u308b\u3068\u8003\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<ul>\n<li>get() \u307e\u3067\u306e\u90e8\u5206\uff1a DB\u304b\u3089\u30c7\u30fc\u30bf\u53d6\u5f97\u3059\u308b\u90e8\u5206<\/li>\n<li>\u305d\u308c\u4ee5\u964d\uff1a \u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf\u306e\u5f62\u3092\u5909\u3048\u308b\u90e8\u5206<\/li>\n<\/ul>\n<p>\u203b\u3061\u306a\u307f\u306b\u3001\u898b\u3084\u3059\u3044\u30b3\u30fc\u30c9\u3068\u3057\u3066\u306f\u534a\u5206\u306b\u5206\u5272\u3057\u305f\u65b9\u304c\u3044\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u4eca\u56de\u306f\u300c\u306a\u3093\u306a\u3089\u5168\u90e8\u3064\u306a\u3052\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u3088\ud83d\udc4d\u300d\u3068\u3044\u3046\u306e\u3092\u3054\u7d39\u4ecb\u3057\u305f\u304b\u3063\u305f\u306e\u3067\u3001\u3053\u306e\u5f62\u306b\u3057\u307e\u3057\u305f\ud83d\ude0a\u2728<\/p>\n<h2>get()\u307e\u3067\u306e\u90e8\u5206<\/h2>\n<p>\u307e\u305a\u3001<code>with()<\/code>\u3067\u7d50\u5408\u3092\u3057\u3066\u3044\u308b\u308f\u3051\u3067\u3059\u304c\u3001\u901a\u5e38\u3067\u306f\u4f7f\u308f\u306a\u3044<code>function(){ ... }<\/code>\u304c\u3064\u3044\u3066\u3044\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f\u3001\u300c<strong>\u7d50\u5408\u5148\u306e\u30c7\u30fc\u30bf\u306b\u3055\u3089\u306b\u6761\u4ef6\u3092\u8ffd\u52a0\u3059\u308b<\/strong>\u300d\u305f\u3081\u306e\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u4eca\u56de\u306e\u4f8b\u3067\u8a00\u3046\u3068\u300c<strong>\u597d\u304d\u306a\u82b8\u4eba\u3055\u3093<\/strong>\u300d\u304c\u4e00\u81f4\u3059\u308b\u30c7\u30fc\u30bf\u3092ID\u3067\u7d5e\u308a\u8fbc\u3093\u3067\u3044\u308b\u308f\u3051\u3067\u3059\u3002\uff08\u3053\u308c\u304c\u306a\u3044\u3068\u3001\u597d\u304d\u3067\u306f\u306a\u3044\u82b8\u4eba\u3055\u3093\u3082\u542b\u3081\u305f\u30c7\u30fc\u30bf\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\uff09<\/p>\n<p>\u305d\u3057\u3066\u3001\u3082\u3061\u308d\u3093\u81ea\u5206\u81ea\u8eab\u307e\u3067\u542b\u3081\u3066\u3057\u307e\u3046\u3068\u3001\u30d5\u30eb\u306b\u30de\u30c3\u30c1\u3057\u3066\u3057\u307e\u3046\u306e\u3067<code>where('id', '!=', $user-&gt;id)<\/code>\u3067\u81ea\u5206\u306f\u7701\u304f\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u6700\u5f8c\u306b\u3053\u3053\u307e\u3067\u306e\u6761\u4ef6\u3067DB\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u306e\u304c<code>get()<\/code>\u3067\u3059\u3002<\/p>\n<h2>\u305d\u308c\u4ee5\u964d\u306e\u90e8\u5206<\/h2>\n<p><code>get()<\/code>\u4ee5\u964d\u306e\u90e8\u5206\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306f\u95a2\u4fc2\u306a\u304f\u3001<code>Laravel<\/code>\u306e<code>Collection<\/code>\u3092\u4f7f\u3063\u305f\u64cd\u4f5c\u306b\u306a\u308a\u307e\u3059\u3002\uff08\u306a\u305c\u306a\u3089\u30e2\u30c7\u30eb\u3092\u4f7f\u3063\u3066\u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf\u306f<code>Collection<\/code>\u306b\u306a\u308b\u304b\u3089\u3067\u3059\uff09<\/p>\n<p>\u307e\u305a\u3001<code>filter()<\/code>\u306f\u300c<strong>\u4e0d\u8981\u306a\u30c7\u30fc\u30bf\u3092\u7701\u304f<\/strong>\u300d\u51e6\u7406\u3092\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u306a\u305c\u306a\u3089\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf\u306b\u306f\u300c<strong>\u307e\u3063\u305f\u304f\u597d\u307f\u304c\u30de\u30c3\u30c1\u3057\u3066\u3044\u306a\u3044\u4eba<\/strong>\u300d\u3082\u542b\u307e\u308c\u3066\u3044\u308b\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001<code>filter()<\/code>\u5185\u3067\uff08\u4eca\u56de\u306e\u30b1\u30fc\u30b9\u3067\u306f\uff09\u300c<strong>\u6700\u4f4e\u3067\u3082\uff11\u4ef6\u4ee5\u4e0a\u597d\u307f\u304c\u30de\u30c3\u30c1\u3057\u3066\u3044\u308b\u4eba\u3060\u3051<\/strong>\u300d\u3092\u6b8b\u3059\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u203b \u306a\u304a\u3001\u4ef6\u6570\u306f<code>MIN_MATCHING_COUNT<\/code>\u3068\u3057\u3066\u3044\u3064\u3067\u3082\u5909\u66f4\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u3082\u3057\u4ed6\u306e\u5834\u6240\u3067\u3082\u4f7f\u3046\u306a\u3089<code>config<\/code>\u30d5\u30a9\u30eb\u30c0\u5185\u3084\u30e2\u30c7\u30eb\u672c\u4f53\u306b\u5b9a\u6570\u3068\u3057\u3066\u30bb\u30c3\u30c8\u3057\u3066\u304a\u3044\u305f\u65b9\u304c\u3044\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u7d9a\u3044\u3066\u3001<code>sortByDesc()<\/code>\u3067\u306f\u3001\u4e26\u3079\u66ff\u3048\u3092\u884c\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u4e26\u3079\u66ff\u3048\u3092\u3059\u308b\u6761\u4ef6\u306f\u3001\u3082\u3061\u308d\u3093\u300c<strong>\u597d\u307f\u304c\u30de\u30c3\u30c1\u3057\u305f\u4ef6\u6570\u304c\u591a\u3044\u4eba\u304c\u5148<\/strong>\u300d\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u3001\u300c<strong>\u597d\u304d\u306a\u82b8\u4eba\u3055\u3093\u304c\u591a\u304f\u30de\u30c3\u30c1\u3057\u3066\u3044\u308b\u4eba\u306e\u30c7\u30fc\u30bf<\/strong>\u300d\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u203b \u306a\u304a\u3001\u4eca\u56de\u306f\u30c7\u30fc\u30bf\u3092\u6bce\u56de\u53d6\u5f97\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u30e6\u30fc\u30b6\u30fc\u6570\u304c\u5897\u3048\u308b\u3068\u51e6\u7406\u306b\u6642\u9593\u304c\u304b\u304b\u308b\u3053\u3068\u304c\u4e88\u60f3\u3055\u308c\u307e\u3059\u306e\u3067\u3001\uff08\u5b9f\u969b\u306e\u958b\u767a\u3067\u306f\uff09\u4f8b\u3048\u3070\u300c<strong>user_favorite_comedians<\/strong>\u300d\u306e\u3088\u3046\u306a\u30c6\u30fc\u30d6\u30eb\u306b\u4fdd\u5b58\u3057\u3001\u4e00\u5b9a\u6642\u9593\u3054\u3068\u306b\u66f4\u65b0\u3059\u308b\u65b9\u304c\u3044\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<h1>\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u7d9a\u3044\u3066\u3001\u5148\u307b\u3069\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u30bb\u30c3\u30c8\u3057\u305f\u30d3\u30e5\u30fc\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>resources\/views\/matching.blade.php<\/strong><\/p>\n<pre><strong>&lt;html&gt;<\/strong>\r\n<strong>&lt;head&gt;<\/strong>\r\n<strong>    &lt;link href=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.0.1\/dist\/css\/bootstrap.min.css\" rel=\"stylesheet\"&gt;<\/strong>\r\n<strong>&lt;\/head&gt;<\/strong>\r\n<strong>&lt;body&gt;<\/strong>\r\n<strong>&lt;div id=\"app\" class=\"p-4\"&gt;<\/strong>\r\n<strong>    &lt;h5&gt;{{ $user-&gt;name }} \u3055\u3093&lt;\/h5&gt;<\/strong>\r\n<strong>    &lt;div&gt;<\/strong>\r\n<strong>        &lt;span class=\"badge bg-primary\"&gt;\u597d\u304d\u306a\u82b8\u4eba\u3055\u3093&lt;\/span&gt; {{ $user-&gt;comedians-&gt;pluck('name')-&gt;join('\u3001') }}<\/strong>\r\n<strong>    &lt;\/div&gt;<\/strong>\r\n<strong>    &lt;hr&gt;<\/strong>\r\n<strong>    &lt;h6 class=\"mb-3\"&gt;\u30de\u30c3\u30c1\u3057\u305f\u30e6\u30fc\u30b6\u30fc&lt;\/h6&gt;<\/strong>\r\n<strong>    &lt;ul&gt;<\/strong>\r\n<strong>    @foreach($matched_users as $matched_user)<\/strong>\r\n<strong>        &lt;li class=\"mb-3\"&gt;<\/strong>\r\n<strong>            {{ $matched_user-&gt;name }} \u3055\u3093&lt;br&gt;<\/strong>\r\n<strong>            &lt;span class=\"badge bg-success\"&gt;\u30de\u30c3\u30c1\u3057\u305f\u82b8\u4eba\u3055\u3093&lt;\/span&gt;\uff08{{ $matched_user-&gt;comedians-&gt;count() }}\u4ef6\uff09<\/strong>\r\n<strong>             {{ $matched_user-&gt;comedians-&gt;pluck('name')-&gt;join('\u3001') }}<\/strong>\r\n<strong>        &lt;\/li&gt;<\/strong>\r\n<strong>    @endforeach<\/strong>\r\n<strong>    &lt;\/ul&gt;<\/strong>\r\n<strong>&lt;\/div&gt;<\/strong>\r\n<strong>&lt;\/body&gt;<\/strong>\r\n<strong>&lt;\/html&gt;<\/strong><\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u5c11\u3057\u30c8\u30ea\u30c3\u30ad\u30fc\u306a\u306e\u304c<code>join()<\/code>\u3092\u4f7f\u3063\u305f\u90e8\u5206\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre><strong>$user-&gt;comedians-&gt;pluck('name')-&gt;join('\u3001')<\/strong><\/pre>\n<p>\u3053\u3053\u306e\u610f\u5473\u3068\u3057\u3066\u306f\u3001\u4ee5\u4e0b\u306e\u6d41\u308c\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u30e6\u30fc\u30b6\u30fc\u30c7\u30fc\u30bf\u3068\u7d50\u5408\u3057\u3066\u3044\u308b\u82b8\u4eba\u3055\u3093\u30c7\u30fc\u30bf\u3092\u53d6\u5f97<\/li>\n<li>\u82b8\u4eba\u3055\u3093\u30c7\u30fc\u30bf\u304b\u3089\u540d\u524d\u3060\u3051\u3092\u53d6\u5f97<\/li>\n<li>\u305d\u308c\u3089\u306e\u540d\u524d\u3092\u300c\u3001\u300d\u3067\u3064\u306a\u3044\u3067\u6587\u5b57\u5217\u306b\u3059\u308b<\/li>\n<\/ol>\n<h1>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u3053\u3053\u307e\u3067\u3067\u4f5c\u3063\u305f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\uff06\u30d3\u30e5\u30fc\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u30eb\u30fc\u30c8\u3092\u8ffd\u52a0\u3057\u3066\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<p><strong>routes\/web.php<\/strong><\/p>\n<pre><strong>use App\\Http\\Controllers\\MatchingController;<\/strong>\r\n\r\n\/\/ \u7701\u7565\r\n\r\n<strong>Route::get('matching\/{user}', [MatchingController::class, 'show']);<\/strong><\/pre>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u4eca\u56de\u958b\u767a\u3057\u305f\u30de\u30c3\u30c1\u30f3\u30b0\u6a5f\u80fd\u3092\u5b9f\u969b\u306b\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u300c<strong>http:\/\/******\/matching\/1<\/strong>\u300d\uff08\u30e6\u30fc\u30b6\u30fcID\u304c\uff11\u306e\u4eba\u306e\u30da\u30fc\u30b8\uff09\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<\/p>\n<p>\u3059\u308b\u3068\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9334\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_matching_3.png\" alt=\"\" width=\"663\" height=\"334\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_matching_3.png 663w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_matching_3-300x151.png 300w\" sizes=\"auto, (max-width: 663px) 100vw, 663px\" \/><\/p>\n<p>\u306f\u3044\u2757\u592a\u90ce\u3055\u3093\u304c\u597d\u304d\u306a\u82b8\u4eba\u3055\u3093\u3068\u30de\u30c3\u30c1\u3057\u305f\u4eba\u305f\u3061\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u6210\u529f\u3067\u3059\ud83d\ude0a<\/p>\n<p>\u3067\u306f\u3001\u6b21\u306b\u300c<strong>http:\/\/******\/matching\/2<\/strong>\u300d\uff08\u30e6\u30fc\u30b6\u30fcID\u304c\uff12\u306e\u4eba\u306e\u30da\u30fc\u30b8\uff09\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3069\u3046\u306a\u308b\u3067\u3057\u3087\u3046\u304b\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb\uff1f\uff1f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9333\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_matching_4.png\" alt=\"\" width=\"542\" height=\"332\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_matching_4.png 542w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_matching_4-300x184.png 300w\" sizes=\"auto, (max-width: 542px) 100vw, 542px\" \/><\/p>\n<p>\u306f\u3044\u2757\u3053\u3061\u3089\u3082\u82b8\u4eba\u3055\u3093\u304c\u30de\u30c3\u30c1\u3057\u3066\u3044\u307e\u3059\u306d\u3002<\/p>\n<p>\u6210\u529f\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<h1>\u4f01\u696d\u69d8\u3078\u306e\u3054\u63d0\u6848<\/h1>\n<p>\u4eca\u56de\u958b\u767a\u3057\u305f\u30de\u30c3\u30c1\u30f3\u30b0\u6a5f\u80fd\u3092\u4f7f\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3053\u3068\u304c\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u5171\u901a\u3059\u308b\u30b9\u30ad\u30eb\u3092\u3082\u3063\u305f\u5f93\u696d\u54e1\u305f\u3061\u304c\u96c6\u307e\u3063\u305f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30fb\u30c1\u30fc\u30e0\u3092\u3064\u304f\u308b<\/li>\n<li>\u5171\u901a\u9805\u76ee\u304c\u591a\u304f\u3042\u308b\u304a\u5ba2\u69d8\u306e\u30b0\u30eb\u30fc\u30d7\u3092\u3064\u304f\u308a\u3001\u305d\u3053\u3092\u30bf\u30fc\u30b2\u30c3\u30c8\u306b\u3057\u305f\u30a2\u30d7\u30ed\u30fc\u30c1\u3092\u5b9f\u65bd\u3059\u308b<\/li>\n<li>\u4eca\u56de\u306e\u3088\u3046\u306b\u300c\u597d\u304d\u306a\u25cf\u25cf\u300d\u3060\u3051\u3067\u306a\u304f\u3001\u3080\u3057\u308d\u300c\u5acc\u3044\u306a\u25cf\u25cf\u300d\u3067\u30de\u30c3\u30c1\u30f3\u30b0\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u3002<\/li>\n<\/ul>\n<p>\u3053\u3046\u3044\u3063\u305f\u5185\u5bb9\u306e\u958b\u767a\u3092\u304a\u8003\u3048\u3067\u3057\u305f\u3089\u3001\u305c\u3072\u304a\u554f\u3044\u5408\u308f\u305b\u304b\u3089\u3054\u9023\u7d61\u304f\u3060\u3055\u3044\u3002\u3069\u3046\u305e\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3044\u305f\u3057\u307e\u3059\u3002m(_ _)m<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f<code>Laravel<\/code>\u3092\u4f7f\u3063\u3066\u7c21\u5358\u306a\u30de\u30c3\u30c1\u30f3\u30b0\u6a5f\u80fd\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u30de\u30c2\u30ab\u30eb\u30e9\u30d6\u30ea\u30fc\u306e\u91ce\u7530\u30af\u30ea\u30b9\u30bf\u30eb\u3055\u3093\u306f\u3054\u81ea\u8eab\u3067\u30d7\u30ed\u30b0\u30e9\u30e0\u3057\u305f\u30b2\u30fc\u30e0\u3067\u30cd\u30bf\u3092\u3057\u3066\u3044\u308b\uff08R-1\u512a\u52dd\u304a\u3081\u3067\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u2757\uff09\u306e\u3067\u3001\u307b\u307c\u306a\u3044\u3067\u3057\u3087\u3046\u304c\u304a\u8fd1\u3065\u304d\u306b\u306a\u308c\u305f\u3089\u3001\u305c\u3072\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u304a\u8a71\u3092\u805e\u3044\u3066\u307f\u305f\u3044\u3082\u3093\u3067\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3068\u3057\u3066\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b<code>HSP<\/code>\u3092\u4f7f\u3063\u3066\u3044\u308b\u3068\u306e\u3053\u3068\u3067\u3057\u305f\u304c\u3001\u3042\u3044\u306b\u304f\u3042\u307e\u308a\u99b4\u67d3\u307f\u304c\u306a\u3044\u3082\u306e\u3060\u3063\u305f\u306e\u3067\u6642\u9593\u304c\u3067\u304d\u305f\u3089\u4e00\u5ea6\u8a66\u3057\u3066\u307f\u305f\u3044\u3067\u3059\u3002<\/p>\n<blockquote class=\"twitter-tweet\">\n<p dir=\"ltr\" lang=\"ja\">\u50d5\u304c\u4f7f\u3063\u3066\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306fHSP\u3068\u8a00\u3063\u3066\u7c21\u5358\u306a\u30b2\u30fc\u30e0\u3092\u4f5c\u308b\u306a\u3089\u7d76\u5bfe\u304a\u3059\u3059\u3081\u306e\u8a00\u8a9e\u3067\u3059<br \/>\n\u6c17\u5408\u3044\u3055\u308c\u3042\u308c\u3070\u5c0f\u5b66\u751f\u3067\u3082\u4f5c\u308c\u307e\u3059<br \/>\n\u30c4\u30af\u30fc\u30eb\u7cfb\u3068\u9055\u3063\u3066\u672c\u5f53\u306b\u3069\u3093\u306a\u30b2\u30fc\u30e0\u3067\u3082\u4f5c\u308c\u307e\u3059<br \/>\n\u5c06\u6765\u30b2\u30fc\u30e0\u30af\u30ea\u30a8\u30a4\u30bf\u30fc\u306b\u306a\u308a\u305f\u3044\u5b50\u4f9b\u304c\u3044\u305f\u3089\u6700\u521d\u306e\u8a00\u8a9e\u306b\u304a\u3059\u3059\u3081\u3067\u3059\uff01<a href=\"https:\/\/t.co\/WofGWAMsSF\">https:\/\/t.co\/WofGWAMsSF<\/a><\/p>\n<p>\u2014 \u30de\u30c2\u30ab\u30eb\u30e9\u30d6\u30ea\u30fc \u91ce\u7530\u30af\u30ea\u30b9\u30bf\u30eb (@nodacry) <a href=\"https:\/\/twitter.com\/nodacry\/status\/1239203860792500229?ref_src=twsrc%5Etfw\">March 15, 2020<\/a><\/p><\/blockquote>\n<p><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<p>\u304d\u3063\u3068\u5c06\u6765\u300c\u91ce\u7530\u3055\u3093\u3092\u898b\u3066\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u3058\u3081\u307e\u3057\u305f\u300d\u3063\u3066\u3044\u3046\u82e5\u624b\u304c\u3067\u3066\u304f\u308b\u3093\u3067\u3057\u3087\u3046\u306d\u3002<\/p>\n<p>\u3068\u306a\u308b\u3068\u3001IT\u696d\u754c\u3078\u306e\u8ca2\u732e\u3082\u3055\u308c\u3066\u3044\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u306d\u3002<br \/>\n\u7d20\u6674\u3089\u3057\u3044\ud83d\udc4d\u2728<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6068 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_12.png\" alt=\"\" width=\"226\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_12.png 226w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_12-212x300.png 212w\" sizes=\"auto, (max-width: 226px) 100vw, 226px\" \/>\u300c\u6700\u8fd1\u306e\u30cf\u30f3\u30c7\u30a3\u30af\u30ea\u30fc\u30ca\u30fc\u3063\u3066<br \/>\n\u3053\u3093\u306a\u306b\u5438\u3044\u8fbc\u3080\u3093\u3067\u3059\u306d\ud83d\ude33\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u5fd9\u3057\u3044\u306a\u304c\u3089\u3082\u65e9\u3044\u4e16\u306e\u4e2d\u306e\u6d41\u308c\u306b\u53d6\u308a\u6b8b\u3055\u308c\u306a\u3044\u3088\u3046\u3001\u3044\u308d\u3044\u308d\u60c5\u5831\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u4e2d\u3067\u3082\u500b\u4eba\u7684\u306b\u597d\u304d\u306a\u306e\u304c\u3001 \uff08\u30b7\u30b9\u30c6\u30e0\u958b\u767a\u306e\uff09 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=9322\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel \u3067\u300c\u597d\u304d\u306a\u82b8\u4eba\u304c\u4f3c\u3066\u308b\u300d\u30de\u30c3\u30c1\u30f3\u30b0\u30b7\u30b9\u30c6\u30e0\u3092\u3064\u304f\u3063\u3066\u307f\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":9341,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-9322","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/9322","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=9322"}],"version-history":[{"count":12,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/9322\/revisions"}],"predecessor-version":[{"id":9342,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/9322\/revisions\/9342"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/9341"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}