{"id":9971,"date":"2022-01-24T07:00:20","date_gmt":"2022-01-23T22:00:20","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=9971"},"modified":"2022-01-24T19:26:36","modified_gmt":"2022-01-24T10:26:36","slug":"%e3%80%90laravel%e3%80%91%e7%b0%a1%e5%8d%98%e3%81%ab%e6%9c%80%e6%96%b0-or-%e6%9c%80%e9%ab%98%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e9%80%a3%e7%b5%90%e3%81%a7%e3%81%8d%e3%82%8b%e3%80%8cone-of-many","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=9971","title":{"rendered":"\u3010Laravel\u3011\u7c21\u5358\u306b\u6700\u65b0 or \u6700\u9ad8\u30c7\u30fc\u30bf\u3092\u9023\u7d50\u3067\u304d\u308b\u300cOne of Many \u300d"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u307e\u3060\u307e\u3060\u79c1\u3082\u672a\u719f\u306a\u30a8\u30f3\u30b8\u30cb\u30a2\u3067\u3059\u306e\u3067\u65e5\u9803\u304b\u3089\u512a\u79c0\u306a\u65b9\u3005\u304b\u3089\u306e\u60c5\u5831\u30c1\u30a7\u30c3\u30af\u306f\u304b\u304b\u3055\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u305d\u3093\u306a\u4e2d\u304b\u3089\u4e45\u3057\u3076\u308a\u306b\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">\u300c\u304a\u3063\u3001\u3053\u308c\u306f\u2757\u300d<\/strong><\/p>\n<p>\u3068\u601d\u3046\u3082\u306e\u3092\u767a\u898b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u308c\u304c\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><strong style=\"font-size: 35px;\">One of Many \u3092\u4f7f\u3063\u305f\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7<\/strong><\/p>\n<p>\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f\u4f8b\u3048\u3070\u3001\u300cA\u3055\u3093\u306e\u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u300d\u3068\u300cA\u3055\u3093\u304c\u6295\u7a3f\u3057\u305f\u8a18\u4e8b\u306e\u4e2d\u304b\u3089<strong>\u6700\u65b0\u306e\u3082\u306e\u3060\u3051<\/strong>\u300d\u3092\u4e00\u7dd2\u306b\u53d6\u5f97\u3067\u304d\u308b\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n<p>\uff08\u4f8b\uff09<\/p>\n<ul>\n<li>id: 1\uff08\u2190\u30e6\u30fc\u30b6\u30fc\u30c6\u30fc\u30d6\u30eb\u304b\u3089\uff09<\/li>\n<li>name: A\u3055\u3093\uff08\u2190\u30e6\u30fc\u30b6\u30fc\u30c6\u30fc\u30d6\u30eb\u304b\u3089\uff09<\/li>\n<li>email\uff1a a@example.com\uff08\u2190\u30e6\u30fc\u30b6\u30fc\u30c6\u30fc\u30d6\u30eb\u304b\u3089\uff09<\/li>\n<li>latest_post\uff1a \uff08\u30bf\u30a4\u30c8\u30eb\u306a\u3069\uff09\uff08<strong>\u2190\u8a18\u4e8b\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u6700\u65b0\u306e\u3082\u306e\u3060\u3051<\/strong>\uff09<\/li>\n<\/ul>\n<p>\u3064\u307e\u308a\u3001\u30b7\u30f3\u30d7\u30eb\u306b\u8a00\u3046\u3068\u300c<strong>1\uff1a\u591a\uff08hasMany\uff09\u306e\u30c7\u30fc\u30bf\u306e\u4e2d\u304b\u3089\u6700\u65b0\u306e\u3082\u306e\u3060\u3051\u3068\u3063\u3066\u304f\u308b<\/strong>\u300d\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u8003\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u305d\u3053\u3067\u2757<\/p>\n<p>\u4eca\u56de\u306f\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u304b\u3089\u300c<strong>\u6700\u3082\u65b0\u3057\u3044\uff08\u53e4\u3044\uff09\u306e\u3082\u306e<\/strong>\u300d\u300c<strong>\u6700\u3082\u5927\u304d\u3044\uff08\u5c0f\u3055\u3044\uff09\u3082\u306e<\/strong>\u300d\u3092\u7c21\u5358\u306b\u53d6\u3063\u3066\u304f\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u300c<strong>One of Many<\/strong>\u300d\u9023\u7d50\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>\u4f55\u304b\u306e\u53c2\u8003\u306b\u306a\u308a\u307e\u3057\u305f\u3089\u5b09\u3057\u3044\u3067\u3059\u3002\ud83d\ude04\u2728<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3405\" 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\" \/><br \/>\n\u300c\u9053\u3067\u30d0\u30c3\u30bf\u30ea\u4f1a\u3063\u305f<br \/>\n\u540c\u7d1a\u751f\u304c\u3001\u4ee3\u8868\u53d6\u7de0\u5f79\u3057\u3066\u3066<br \/>\n\u30d3\u30c3\u30af\u30ea\u3057\u307e\u3057\u305f \ud83d\ude33\u300d<\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 8.79.0<\/p>\n<h1>One of Many \u9023\u7d50\u306b\u3064\u3044\u3066<\/h1>\n<p><code>One of Many<\/code>\u306f\u3001<code>Laravel 8.42<\/code>\u3067\u8ffd\u52a0\u3055\u308c\u305f\u65b0\u6a5f\u80fd\u3067\u3059\u3002<br \/>\n\u305d\u306e\u305f\u3081\u3001<code>Laravel 8.x<\/code>\u3092\u4f7f\u3063\u3066\u3044\u3066\u3082\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u3054\u6ce8\u610f\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u306a\u304a\u3001<code>Laravel<\/code>\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u306f\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3060\u3051\u3067OK\u3067\u3059\u3002<\/p>\n<pre><strong>composer update<\/strong><\/pre>\n<h1>\u3053\u306e\u8a18\u4e8b\u306e\u8da3\u65e8<\/h1>\n<p><code>One of Many<\/code>\u306f\u305d\u308c\u307b\u3069\u6700\u8fd1\u8ffd\u52a0\u3055\u308c\u305f\u3082\u306e\u3067\u306f\u306a\u3044\uff082021.5.18\uff09\u3067\u3059\u3057\u3001\u8a73\u3057\u3044\u5185\u5bb9\u306f\u4ed6\u306e\u30b5\u30a4\u30c8\u3067\u3082\u7d39\u4ecb\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3053\u306e\u8a18\u4e8b\u3067\u306f\u5b9f\u969b\u306b\u3069\u3046\u3084\u308c\u3070<code>One of Many<\/code>\u304c\u4f7f\u3048\u308b\u304b\u3092\u9806\u3092\u8ffd\u3063\u3066\u3054\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h1>\u5fc5\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u307e\u305a\u306fDB\u307e\u308f\u308a\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u3064\u304f\u308a\u307e\u3059\u3002<br \/>\n\u4f5c\u6210\u3059\u308b\u306e\u306f\u300c<strong>\u751f\u5f92<\/strong>\u300d\uff06\u300c<strong>\uff08\u751f\u5f92\u306e\uff09\u30c6\u30b9\u30c8\u7d50\u679c<\/strong>\u300d\u3067\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u5fc5\u8981\u306a\u30c6\u30fc\u30d6\u30eb\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<li>students: \u751f\u5f92\u30c7\u30fc\u30bf<\/li>\n<li>examinations: \u904e\u53bb\u306b\u53d7\u3051\u305f\u30c6\u30b9\u30c8\u306e\u7d50\u679c\uff08\u751f\u5f92\u3054\u3068\u306b\u8907\u6570OK\uff09<\/li>\n<\/ul>\n<p>\u3067\u306f\u3001\u3053\u308c\u3089\u5fc5\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u3064\u304f\u308b\u305f\u3081\u306b\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 Student -ms<\/strong><\/pre>\n<pre><strong>php artisan make:model Examination -ms<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u300c<strong>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3<\/strong>\u300d\u300c<strong>\u30e2\u30c7\u30eb<\/strong>\u300d\u300c<strong>Seeder<\/strong>\u300d\u304c\uff12\u30bb\u30c3\u30c8\uff08\u5408\u8a08\uff16\u30d5\u30a1\u30a4\u30eb\uff09\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u3064\u304f\u308b<\/h2>\n<p>\u3067\u306f\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>database\/migrations\/****_**_**_******_create_students_table.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function up()\r\n{\r\n    <strong>Schema::create('students', function (Blueprint $table) {<\/strong>\r\n<strong>        $table-&gt;id();<\/strong>\r\n<strong>        $table-&gt;string('name')-&gt;comment('\u751f\u5f92\u540d');<\/strong>\r\n<strong>        $table-&gt;timestamps();<\/strong>\r\n<strong>    });<\/strong>\r\n}<\/pre>\n<p><strong>database\/migrations\/****_**_**_******_create_examinations_table.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function up()\r\n{\r\n    <strong>Schema::create('examinations', function (Blueprint $table) {<\/strong>\r\n<strong>        $table-&gt;id();<\/strong>\r\n<strong>        $table-&gt;unsignedBigInteger('student_id')-&gt;comment('\u751f\u5f92ID');<\/strong>\r\n<strong>        $table-&gt;unsignedInteger('score')-&gt;comment('\u70b9\u6570');<\/strong>\r\n<strong>        $table-&gt;timestamps();<\/strong>\r\n\r\n<strong>        $table-&gt;foreign('student_id')-&gt;references('id')-&gt;on('students')-&gt;onDelete('cascade');<\/strong>\r\n<strong>    });<\/strong>\r\n}<\/pre>\n<h2>Seeder \u3067\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u3064\u304f\u308b<\/h2>\n<p>\u7d9a\u3044\u3066\u3001\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3092<code>students<\/code>\u3068<code>examinations<\/code>\u30c6\u30fc\u30d6\u30eb\u306b\u7528\u610f\u3059\u308b\u305f\u3081\u306e<code>Seeder<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u3064\u304f\u308a\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u751f\u5f92\u30c7\u30fc\u30bf\u3067\u3059\u3002<\/p>\n<p><strong>database\/seeders\/StudentSeeder.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function run()\r\n{\r\n<strong>    $names = [<\/strong>\r\n<strong>        '\u5c71\u7530\u592a\u90ce',<\/strong>\r\n<strong>        '\u4f50\u85e4\u6b21\u90ce',<\/strong>\r\n<strong>        '\u7530\u4e2d\u4e09\u90ce',<\/strong>\r\n<strong>        '\u5c71\u672c\u56db\u90ce',<\/strong>\r\n<strong>        '\u85e4\u539f\u4e94\u90ce',<\/strong>\r\n<strong>    ];<\/strong>\r\n\r\n<strong>    foreach ($names as $name) {<\/strong>\r\n\r\n<strong>        $student = new Student();<\/strong>\r\n<strong>        $student-&gt;fill(['name' =&gt; $name]);<\/strong>\r\n<strong>        $student-&gt;save();<\/strong>\r\n        \r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u305d\u3057\u3066\u3001\u30c6\u30b9\u30c8\u7d50\u679c\u306e\u30c7\u30fc\u30bf\u3067\u3059\u3002<\/p>\n<p><strong>database\/seeders\/ExaminationSeeder.php<\/strong><\/p>\n<pre>public function run()\r\n{\r\n    <strong>$students = Student::get();<\/strong>\r\n\r\n<strong>    foreach ($students as $student) {<\/strong>\r\n\r\n<strong>        for($i = 0 ; $i &lt; 10 ; $i++) {<\/strong>\r\n\r\n<strong>            $dt = now()-&gt;subDays(rand(1, 365)); \/\/ 1 \u301c 365\u65e5\u524d\u306e\u65e5\u4ed8<\/strong>\r\n\r\n<strong>            $examination = new Examination();<\/strong>\r\n<strong>            $examination-&gt;fill([<\/strong>\r\n<strong>                'student_id' =&gt; $student-&gt;id,<\/strong>\r\n<strong>                'score' =&gt; rand(0, 100),<\/strong>\r\n<strong>                'created_at' =&gt; $dt,<\/strong>\r\n<strong>                'updated_at' =&gt; $dt,<\/strong>\r\n<strong>            ]);<\/strong>\r\n<strong>            $examination-&gt;save();<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u203b \u3061\u306a\u307f\u306b\u4eca\u56de\u306f<code>fill()<\/code>\u3092\u4f7f\u3063\u3066\u30c7\u30fc\u30bf\u3092\u30bb\u30c3\u30c8\u3057\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n<code>Laravel<\/code>\u306f\u4fdd\u5b58\u3060\u3051\u898b\u3066\u3082\u3044\u308d\u3093\u306a\u3084\u308a\u304b\u305f\u304c\u3042\u308b\u306e\u3067\u3001\u305c\u3072\u81ea\u5206\u306b\u5408\u3063\u305f\u3082\u306e\u3092\u898b\u3064\u3051\u3066\u304f\u3060\u3055\u3044\ud83d\udc4d<\/p>\n<p><code>Seeder<\/code>\u30d5\u30a1\u30a4\u30eb\u306f\u4f5c\u6210\u3057\u305f\u3060\u3051\u3067\u306f\u5b9f\u884c\u3055\u308c\u306a\u3044\u306e\u3067\u3001<code>DatabaseSeeder.php<\/code>\u306b\u30bb\u30c3\u30c8\u3057\u307e\u3059\u3002<\/p>\n<p><strong>database\/seeders\/DatabaseSeeder.php<\/strong><\/p>\n<pre>class DatabaseSeeder extends Seeder\r\n{\r\n    \/\/ \u7701\u7565\r\n\r\n    public function run()\r\n    {\r\n        \/\/ \u7701\u7565\r\n\r\n<strong>        $this-&gt;call(StudentSeeder::class);<\/strong>\r\n<strong>        $this-&gt;call(ExaminationSeeder::class);<\/strong>\r\n    }\r\n}<\/pre>\n<p>\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067DB\u3092\u518d\u69cb\u7bc9\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\u3053\u3046\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9973\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_1.png\" alt=\"\" width=\"488\" height=\"379\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_1.png 488w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_1-300x233.png 300w\" sizes=\"auto, (max-width: 488px) 100vw, 488px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9974\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_2.png\" alt=\"\" width=\"571\" height=\"428\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_2.png 571w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_2-300x225.png 300w\" sizes=\"auto, (max-width: 571px) 100vw, 571px\" \/><\/p>\n<h1>\u30e2\u30c7\u30eb\u3092\u5909\u66f4\u3059\u308b<\/h1>\n<p>\u3067\u306f\u3001\u3053\u3053\u304b\u3089\u304c\u4eca\u56de\u306e\u672c\u984c\u300c<strong>One of Many<\/strong>\u300d\u9023\u7d50\u3067\u3059\u3002<br \/>\n\u3072\u3068\u3064\u305a\u3064\u3054\u7d39\u4ecb\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u203b \u306a\u304a\u4eca\u56de\u306f\u5206\u304b\u308a\u3084\u3059\u3044\u3088\u3046\u306b\u3001\u300c<strong>\u5c71\u7530\u592a\u90ce<\/strong>\u300d\u3055\u3093\u3060\u3051\u306b\u30d5\u30a9\u30fc\u30ab\u30b9\u3057\u3066\u3054\u7d39\u4ecb\u3057\u307e\u3059\u304c\u3001\u305d\u306e\u4ed6\u3067\u3082\u540c\u3058\u3067\u3059\u3002<\/p>\n<p>\u300c<strong>\u5c71\u7530\u592a\u90ce<\/strong>\u300d\u3055\u3093\u306e\u5b9f\u969b\u306e\u30c7\u30fc\u30bf\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9975\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_3.png\" alt=\"\" width=\"565\" height=\"302\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_3.png 565w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_3-300x160.png 300w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/p>\n<h2>\u6700\u65b0\u306e\u30c7\u30fc\u30bf\u3068\u4e00\u7dd2\u306b\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u3067\u306f\u3001\u307e\u305a\u306f\u300c<strong>\u5c71\u7530\u592a\u90ce\u3055\u3093<\/strong>\u300d\u3068\u3001\u300c<strong>\u5c71\u7530\u592a\u90ce\u3055\u3093\u304c\u4e00\u756a\u6700\u5f8c\u306b\u53d7\u3051\u305f\u6700\u65b0\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf<\/strong>\u300d\u3092\u4e00\u7dd2\u306b\u53d6\u5f97\u3059\u308b\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>app\/Models\/Student.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\nclass Student extends Model\r\n{\r\n    \/\/ \u7701\u7565\r\n\r\n    \/\/ Relationship\r\n<strong>    public function latest_examination() \/\/ \u4e00\u756a\u65b0\u3057\u3044\u30c6\u30b9\u30c8\u7d50\u679c<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        return $this-&gt;hasOne(Examination::class, 'student_id', 'id')-&gt;latestOfMany();<\/strong>\r\n<strong>    }<\/strong><\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001<code>hasOne()<\/code>\u306b\u7d9a\u3051\u3066<code>latestOfMany()<\/code>\u3092\u547c\u3076\u3060\u3051\u3067OK\u3067\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u5b9f\u884c\u3059\u308b\u306e\u306f\u901a\u5e38\u3069\u304a\u308a\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u3068\u4e00\u7dd2\u306b\u30c7\u30fc\u30bf\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>$student = \\App\\Models\\Student::with('latest_examination')-&gt;find(1);<\/strong>\r\n\r\ndd($student-&gt;toArray());<\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9976\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_4.png\" alt=\"\" width=\"313\" height=\"229\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_4.png 313w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_4-300x219.png 300w\" sizes=\"auto, (max-width: 313px) 100vw, 313px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u3053\u306e\u3088\u3046\u306b\u300c<strong>\u5c71\u7530\u592a\u90ce<\/strong>\u300d\u3055\u3093\u306e\u30c6\u30b9\u30c8\u7d50\u679c\u306e\u4e2d\u3067\u300c<strong>\u4e00\u756a ID\u756a\u53f7 \u304c\u5927\u304d\u3044\u30c7\u30fc\u30bf\u300d<\/strong>\u304c\u4e00\u7dd2\u306b\u53d6\u5f97\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9977\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_5.png\" alt=\"\" width=\"565\" height=\"302\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_5.png 565w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_5-300x160.png 300w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/p>\n<p>\u26a0 \u3053\u3053\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u306a\u306e\u3067\u3059\u304c\u3001\u901a\u5e38\u306f\u300c<strong>ID \u304c\u4e00\u756a\u5927\u304d\u3044 \uff1d \u6700\u65b0\u30c7\u30fc\u30bf<\/strong>\u300d\u3068\u306a\u308a\u307e\u3059\u304c\u3001\u4eca\u56de\u306f\u30c7\u30fc\u30bf\u3092\u30e9\u30f3\u30c0\u30e0\u306b\u7528\u610f\u3057\u305f\u3053\u3068\u3082\u3042\u3063\u3066\u6700\u65b0\u306e\u65e5\u6642\u306f\u3001<code>ID: 9<\/code>\u306e\u300c<strong>2021-12-06 03:39:41<\/strong>\u300d\u306e\u3082\u306e\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9978\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_6.png\" alt=\"\" width=\"565\" height=\"302\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_6.png 565w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_6-300x160.png 300w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/p>\n<p>\u3082\u3057\u3053\u3093\u306a\u5834\u5408\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u30bf\u30fc\u30b2\u30c3\u30c8\u306b\u306a\u308b\u30ab\u30e9\u30e0\u540d\u3092\u30bb\u30c3\u30c8\u3059\u308c\u3070OK\u3067\u3059\u3002<\/p>\n<p><strong>app\/Models\/Student.php<\/strong><\/p>\n<pre>class Student extends Model\r\n{\r\n    \/\/ \u7701\u7565\r\n\r\n    \/\/ Relationship\r\n    public function latest_examination_date_time() \/\/ \u4e00\u756a\u65b0\u3057\u3044\u30c6\u30b9\u30c8\u7d50\u679c\uff08\u65e5\u6642\uff09\r\n    {\r\n        return $this-&gt;hasOne(Examination::class, 'student_id', 'id')-&gt;<strong>latestOfMany('created_at');<\/strong> \/\/ \ud83d\udc48 \u30ab\u30e9\u30e0\u540d\u3092\u30bb\u30c3\u30c8\u3059\u308b\r\n    }<\/pre>\n<p>\u305d\u3057\u3066\u3001\u547c\u3073\u51fa\u3057\u65b9\u3082\u5148\u307b\u3069\u3068\u540c\u3058\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>$student = \\App\\Models\\Student::with('latest_examination_date_time')-&gt;find(1);<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u5b9f\u969b\u306e\u7d50\u679c\u306f\u3053\u3046\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9979\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_7.png\" alt=\"\" width=\"310\" height=\"228\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_7.png 310w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_7-300x221.png 300w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/><\/p>\n<p>\u5148\u307b\u3069\u306f<code>ID: 10<\/code>\u3067\u3057\u305f\u304c\u3001\u4eca\u56de\u306f\u6700\u65b0\u65e5\u6642\u306e\u30c7\u30fc\u30bf\u3092\u3082\u3063\u305f<code>ID: 9<\/code>\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3081\u3061\u3083\u304f\u3061\u3083\u4fbf\u5229\u3067\u3059\u306d\ud83d\udc4d<\/p>\n<h2>\u6700\u53e4\u306e\u30c7\u30fc\u30bf\u3068\u4e00\u7dd2\u306b\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u4e00\u756a\u53e4\u3044\u30c7\u30fc\u30bf\u3068\u4e00\u7dd2\u306b\u30c7\u30fc\u30bf\u53d6\u5f97\u3059\u308b\u306e\u306f\u3001\u5148\u307b\u3069\u306e<code>latestOfMany()<\/code>\u3068\u307b\u307c\u540c\u3058\u306a\u306e\u3067\u7701\u7565\u3057\u3066\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p><strong>app\/Models\/Student.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\nclass Student extends Model\r\n{\r\n    \/\/ \u7701\u7565\r\n\r\n    \/\/ Relationship\r\n    <strong>public function oldest_examination() \/\/ \u4e00\u756a\u53e4\u3044\u30c6\u30b9\u30c8\u7d50\u679c<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        return $this-&gt;hasOne(Examination::class, 'student_id', 'id')-&gt;oldestOfMany();<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n    <strong>public function oldest_examination_date_time() \/\/ \u4e00\u756a\u53e4\u3044\u30c6\u30b9\u30c8\u7d50\u679c\uff08\u65e5\u6642\uff09<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        return $this-&gt;hasOne(Examination::class, 'student_id', 'id')-&gt;oldestOfMany('created_at');<\/strong>\r\n<strong>    }<\/strong><\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001<code>latestOfMany()<\/code>\u304c<code>oldestOfMany()<\/code>\u306b\u5909\u66f4\u306b\u306a\u3063\u305f\u3060\u3051\u3067OK\u3067\u3059\u3002\u3053\u3061\u3089\u3082\u7c21\u5358\u3067\u3059\u306d\ud83d\udc4d<\/p>\n<p>\u305d\u3057\u3066\u3001\u547c\u3073\u51fa\u3057\u65b9\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<pre>\/\/ ID \u30d9\u30fc\u30b9\r\n<strong>$student = \\App\\Models\\Student::with('oldest_examination')-&gt;find(1);<\/strong>\r\n\r\n\/\/ \u65e5\u6642\u30d9\u30fc\u30b9\r\n<strong>$student = \\App\\Models\\Student::with('oldest_examination_date_time')-&gt;find(1);<\/strong><\/pre>\n<h2>\u6700\u9ad8\u5f97\u70b9\u30c7\u30fc\u30bf\u3068\u4e00\u7dd2\u306b\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u300c<strong>\u5c71\u7530\u592a\u90ce\u3055\u3093<\/strong>\u300d\u304c\u904e\u53bb\u306b\u53d7\u3051\u305f\u30c6\u30b9\u30c8\u306e\u4e2d\u3067<strong>\u4e00\u756a\u9ad8\u3044\u5f97\u70b9\u306e\u30c7\u30fc\u30bf<\/strong>\u3068\u4e00\u7dd2\u306b\u53d6\u5f97\u3059\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u4eca\u56de\u306e\u30c7\u30fc\u30bf\u3067\u8a00\u3046\u3068<code>86\u70b9<\/code>\u304c\u53d6\u5f97\u3067\u304d\u308c\u3070\u6210\u529f\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9980\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_8.png\" alt=\"\" width=\"565\" height=\"302\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_8.png 565w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_8-300x160.png 300w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/p>\n<p>\u3084\u308a\u65b9\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><strong>app\/Models\/Student.php<\/strong><\/p>\n<pre>class Student extends Model\r\n{\r\n    \/\/ \u7701\u7565\r\n\r\n    \/\/ Relationship\r\n    public function highest_score() \/\/ \u6700\u9ad8\u5f97\u70b9\r\n    {\r\n        <strong>return $this-&gt;hasOne(Examination::class, 'student_id', 'id')-&gt;ofMany('score', 'max');<\/strong>\r\n    }<\/pre>\n<p>\u5148\u307b\u3069\u3068\u4f3c\u3066\u3044\u307e\u3059\u304c\u3001\u4eca\u56de\u306f<code>ofMany()<\/code>\u3092\u4f7f\u3063\u3066\u3001\u30bf\u30fc\u30b2\u30c3\u30c8\u306b\u306a\u308b\u30ab\u30e9\u30e0\u540d<code>score<\/code>\u3068<code>max<\/code>\uff08\u6700\u5927\uff09\u3092\u30bb\u30c3\u30c8\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u4eca\u56de\u3082\u901a\u5e38\u901a\u308a\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u3092\u547c\u3073\u51fa\u3059\u3060\u3051\u3067OK\u3067\u3059\u3002<\/p>\n<pre><strong>$student = \\App\\Models\\Student::with('highest_score')-&gt;find(1);<\/strong><\/pre>\n<p>\u5b9f\u969b\u306e\u30c7\u30fc\u30bf\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9981\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_9.png\" alt=\"\" width=\"305\" height=\"228\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_9.png 305w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_9-300x224.png 300w\" sizes=\"auto, (max-width: 305px) 100vw, 305px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u6700\u9ad8\u5f97\u70b9\u306e<code>86\u70b9<\/code>\u304c\u53d6\u5f97\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\uff08\u306a\u304a\u3001\u30db\u30f3\u30c8\u306f\u30b5\u30f3\u30d7\u30eb\u3068\u3057\u3066\u9055\u3046ID\u306e\u30c7\u30fc\u30bf\u306e\u65b9\u304c\u826f\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u306e\u904b\u304c\u60aa\u304b\u3063\u305f\u3067\u3059\u2026\ud83d\ude25\uff09<\/p>\n<h2>\u6700\u4f4e\u5f97\u70b9\u30c7\u30fc\u30bf\u3068\u4e00\u7dd2\u306b\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u52d8\u304c\u3044\u3044\u65b9\u306a\u3089\u3082\u3046\u304a\u308f\u304b\u308a\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u3055\u3063\u304d\u306e<code>max<\/code>\u3092<code>min<\/code>\u306b\u5909\u66f4\u3059\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\nclass Student extends Model\r\n{\r\n    \/\/ \u7701\u7565\r\n\r\n    \/\/ Relationship\r\n    public function lowest_score() \/\/ \u6700\u4f4e\u5f97\u70b9\r\n    {\r\n        <strong>return $this-&gt;hasOne(Examination::class, 'student_id', 'id')-&gt;ofMany('score', 'min');<\/strong>\r\n    }<\/pre>\n<p>\u4f7f\u3044\u65b9\u3082\u540c\u3058\u3067\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>$student = \\App\\Models\\Student::with('lowest_score')-&gt;find(1);<\/strong><\/pre>\n<p>\u5b9f\u969b\u306e\u7d50\u679c\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9982\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_10.png\" alt=\"\" width=\"307\" height=\"227\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_10.png 307w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_10-300x222.png 300w\" sizes=\"auto, (max-width: 307px) 100vw, 307px\" \/><\/p>\n<p>\u30c7\u30fc\u30bf\u306f\u3053\u3061\u3089\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9983\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_11.png\" alt=\"\" width=\"565\" height=\"302\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_11.png 565w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/01\/laravel_one_of_many_11-300x160.png 300w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/p>\n<h1>\u4f01\u696d\u69d8\u3078\u306e\u3054\u63d0\u6848<\/h1>\n<p>\u4eca\u56de\u3054\u7d39\u4ecb\u3057\u305f\u5185\u5bb9\u306e\u3088\u3046\u306b\u300c\u3088\u308a\u52b9\u7387\u7684\u306a\u30b3\u30fc\u30c9\u300d\u3092\u66f8\u304f\u3088\u3046\u306b\u3059\u308b\u3068\u3001\u958b\u767a\u30b9\u30d4\u30fc\u30c9\u3092\u4e0a\u3052\u305f\u308a\u3001\u30e1\u30f3\u30c6\u30f3\u30ca\u30f3\u30b9\u3057\u3084\u3059\u304f\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3082\u3057\u305d\u3046\u3044\u3063\u305f\u958b\u767a\u3092\u3054\u5e0c\u671b\u3067\u3057\u305f\u3089\u3001\u304a\u554f\u3044\u5408\u308f\u305b\u304b\u3089\u305c\u3072\u3054\u4f9d\u983c\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u304a\u5f85\u3061\u3057\u3066\u304a\u308a\u307e\u3059\u3002m(_ _)m<\/p>\n<h1>\u304a\u308f\u308a<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f<code>Laravel<\/code>\u306e\uff08\u3061\u3087\u3063\u3068\u3060\u3051\uff09\u65b0\u3057\u3044\u6a5f\u80fd\u300c<strong>One of Many<\/strong>\u300d\u3092\u30b5\u30f3\u30d7\u30eb\u3092\u4f7f\u3063\u3066\u3054\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u308c\u306f\u500b\u4eba\u7684\u306b\u3067\u3059\u304c\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3082\u6cd5\u5f8b\u3082\u300c<strong>\u77e5\u3063\u3066\u3044\u308b\u4eba\u304c\u5f97\u3092\u3059\u308b\uff08\u2252 \u77e5\u3089\u306a\u3044\u4eba\u306f\u30bd\u30f3\u3092\u3059\u308b\uff09<\/strong>\u300d\u4e16\u754c\u3067\u3059\u306e\u3067\u3001\u5b8c\u74a7\u306b\u899a\u3048\u3066\u304a\u304f\u5fc5\u8981\u306f\u306a\u3044\u3067\u3059\u304c\u300c<strong>\u3042\u3001\u305d\u3046\u3044\u3048\u3070\u30e9\u30af\u3067\u304d\u308b\u3093\u3058\u3083\u306a\u304b\u3063\u305f\u3051\uff1f\uff1f \u691c\u7d22 \u691c\u7d22\u2757<\/strong>\u300d\u3050\u3089\u3044\u306b\u3057\u3066\u304a\u3044\u3066\u640d\u3059\u308b\u3053\u3068\u306f\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u3082\u3001\u30b5\u30f3\u30d7\u30eb\u3092\u4f7f\u3063\u3066\u4fbf\u5229\u3055\u3092\u4f53\u611f\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7083 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/profile_piano_150x150.png\" alt=\"\" width=\"150\" height=\"150\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/profile_piano_150x150.png 150w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/profile_piano_150x150-100x100.png 100w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/><\/p>\n<p style=\"text-align: center;\"><span style=\"font-size: 1rem;\">\u300c\u30d4\u30a2\u30ce\u306e\u5f3e\u304d\u65b9\u3092\u5909\u3048\u305f\u3089<br \/>\n\u30df\u30b9\u30bf\u30c3\u30c1\u3060\u3089\u3051\u2026<br \/>\n<code>YouTuber<\/code>\u3068\u304b\u30b9\u30b4\u3059\u304e\u307e\u3059\ud83d\ude23\u300d<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u307e\u3060\u307e\u3060\u79c1\u3082\u672a\u719f\u306a\u30a8\u30f3\u30b8\u30cb\u30a2\u3067\u3059\u306e\u3067\u65e5\u9803\u304b\u3089\u512a\u79c0\u306a\u65b9\u3005\u304b\u3089\u306e\u60c5\u5831\u30c1\u30a7\u30c3\u30af\u306f\u304b\u304b\u3055\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002 \u305d\u3057\u3066\u3001\u305d\u3093\u306a\u4e2d\u304b\u3089\u4e45\u3057\u3076\u308a\u306b\u3001 \u300c\u304a\u3063\u3001\u3053\u308c &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=9971\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u3010Laravel\u3011\u7c21\u5358\u306b\u6700\u65b0 or \u6700\u9ad8\u30c7\u30fc\u30bf\u3092\u9023\u7d50\u3067\u304d\u308b\u300cOne of Many \u300d&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":9986,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-9971","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\/9971","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=9971"}],"version-history":[{"count":4,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/9971\/revisions"}],"predecessor-version":[{"id":10026,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/9971\/revisions\/10026"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/9986"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9971"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9971"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9971"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}