{"id":3296,"date":"2026-09-05T14:01:06","date_gmt":"2026-09-05T05:01:06","guid":{"rendered":"https:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/?page_id=3296"},"modified":"2026-09-21T15:20:20","modified_gmt":"2026-09-21T06:20:20","slug":"laravel-09","status":"publish","type":"page","link":"https:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/programming\/php\/laravel-09","title":{"rendered":"\u7a2e\u5b50\u3068\u690d\u7269\u306e\u9023\u643a"},"content":{"rendered":"<details>\n  <summary>\n    \u524d\u56de\u7d42\u4e86\u6642\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\n  <\/summary>\n  <p>Laravel\u3092\u4f7f\u3063\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n<div class='console'><pre>\n$ git clone https:\/\/kiku3.tsbio.info\/git\/study-laravel.git study_laravel\n<\/pre><\/div>\n\n<p>\u3053\u306e\u7ae0\u958b\u59cb\u6642\u70b9\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f chapt9 \u30d6\u30e9\u30f3\u30c1\u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n<div class='console'><pre>\n$ git switch chapt9\n<\/pre><\/div>\n\n<p>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u81ea\u5206\u3067\u66f8\u3044\u3066\u3044\u304f\u5834\u5408\u306f\u3001\u81ea\u5206\u7528\u306e\u30d6\u30e9\u30f3\u30c1\u3092\u3064\u304f\u308b\u3068\u3088\u3044\u3067\u3059\u3002<\/p>\n<div class='console'><pre>\n$ git switch -c my9 chapt9\n<\/pre><\/div>\n\n<p>Laravel\u306e\u30b3\u30fc\u30c9\u306fsrc\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304b\u3089\u306e\u76f8\u5bfe\u30d1\u30b9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n<h3>\u30a8\u30e9\u30fc\u3078\u306e\u5bfe\u51e6<\/h3>\n<ul>\n  <li>\n    <h4>Laravel\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u306a\u3044<\/h4>\n    <p>composer install \u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u958b\u767a\u6bb5\u968e\u306b\u5fdc\u3058\u3066\u4e0d\u8db3\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u3042\u308b\u3068\u304d\u306f\u3001\u518d\u5ea6 composer install \u304c\u5fc5\u8981\u306a\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n  <\/li>\n  <li>\n    <h4>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u304c\u6b63\u3057\u304f\u306a\u3044<\/h4>\n    <p>tempnam()\u304c\u5b9f\u884c\u3067\u304d\u306a\u3044\u306a\u3069\u306e\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u3068\u304d\u306f\u3001storage\u3068bootstrap\/cache\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u6240\u6709\u8005\u3068\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044(\u7b2c1\u7ae0\u3092\u53c2\u7167)<\/p>\n  <\/li>\n  <li>\n    <h4>Vite manifest not found <\/h4>\n    <p>\u958b\u767a\u4e2d\u306a\u3089 npm run dev\u3001\u672c\u756a\u74b0\u5883\u306a\u3089 npm run build\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n  <\/li>\n  <li>\n    <h4>npm run dev\u304c\u52d5\u304b\u306a\u3044<\/h4>\n    <p>npm install \u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n  <\/li>\n<\/ul>\n<\/details>\n\n\n<p>\u7a2e\u5b50\u3092\u307e\u3044\u3066\u690d\u7269\u306b\u3001\u690d\u7269\u304b\u3089\u7a2e\u5b50\u3092\u56de\u53ce\u3059\u308b\u3001\u3068\u3044\u3046\u30b5\u30a4\u30af\u30eb\u3092\u5b9f\u73fe\u3059\u308b\u3002<\/p>\n<h2>\u7a2e\u5b50\u304b\u3089\u690d\u7269\u3078<\/h2>\n<p>\u7a2e\u307e\u304d\u3092\u3057\u3066\u3001\u82bd\u304c\u51fa\u305f\u3089\u9262\u306b\u690d\u3048\u307e\u3059\u3002\n\u9262\u306b\u3064\u3051\u308b\u30e9\u30d9\u30eb\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306b\u3001seed\u30c6\u30fc\u30d6\u30eb\u306e\u60c5\u5831\u304b\u3089plant\u30c6\u30fc\u30d6\u30eb\u306e\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u3092\u3064\u304f\u308a\u307e\u3059\u3002\n\u3053\u308c\u3092\u884c\u3046\u305f\u3081\u306b\u3001seed\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u300c\u9262\u690d\u3048\u300d\u30bf\u30d6\u3092\u3064\u304f\u308a\u3001plantation\u3068\u3044\u3046\u6a5f\u80fd\u3092\u3064\u304f\u308a\u307e\u3059\u3002<\/p>\n<p>\u30e6\u30fc\u30b6\u30fc\u306f\u6b21\u306e\u3053\u3068\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u7a2e\u5b50\u306e\u4e00\u89a7\u3067\u64ad\u3044\u305f\u7a2e\u3092\u63a2\u3059(\u30c1\u30a7\u30c3\u30af\u3092\u3044\u308c\u308b)\u3002<\/li>\n<li>\u9262\u690d\u3048\u306e\u30da\u30fc\u30b8\u306b\u3044\u3063\u3066\u3001\u7a2e\u307e\u304d\u306e\u65e5\u3001\u9262\u690d\u3048\u306e\u65e5\u3001\u80b2\u6210\u8005\u306e\u60c5\u5831\u3092\u5165\u529b\u3057\u3001\u690d\u7269\u30c6\u30fc\u30d6\u30eb\u306b\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/li>\n<li>\u690d\u7269\u306e\u4e00\u89a7\u3067\u8ffd\u52a0\u3055\u308c\u305f\u3082\u306e\u306e\u30e9\u30d9\u30eb\u3092\u5370\u5237\u3059\u308b\u3002<\/li>\n<\/ol>\n<p>2\u304cplantation\u306e\u6a5f\u80fd\u3067\u3001\u7a2e\u5b50\u306e\u30c7\u30fc\u30bf\u3092\u690d\u7269\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002\n\u7a2e\u5b50\u30c7\u30fc\u30bf(Seed\u30e2\u30c7\u30eb)\u3092\u690d\u7269\u30c7\u30fc\u30bf(Plant\u30ea\u30af\u30a8\u30b9\u30c8)\u306b\u5909\u63db\u3057\u3001\/plant\/store\u306b\u9001\u4fe1\u3057\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306e\u624b\u9806\u3067plantation\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u307e\u3059\u3002<\/p>\n<p><\/p>\n<ol>\n<li><code>resources\/views\/seed\/module.blade.php<\/code> \u306b\u300c\u9262\u690d\u3048\u300d\u306e\u30bf\u30d6\u3092\u8ffd\u52a0\u3059\u308b\u3002\n<\/li>\n<li><code>routs\/seed.php<\/code> \u306b \/seed\/plantation \u3078\u306e\u30eb\u30fc\u30c8\u3092\u8ffd\u52a0\u3059\u308b\u3002\n<\/li>\n<li><code>app\/Http\/Controllers\/SeedController.blade.php<\/code> \u306b plantation \u306e\u30d3\u30e5\u30fc\u3092\u8fd4\u3059\u30e1\u30bd\u30c3\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3002\n<\/li>\n<li><code>resources\/views\/seed\/plantation.blade.php<\/code> \u3092\u3064\u304f\u3063\u3066\u3001seed\u30e2\u30b8\u30e5\u30fc\u30eb\u306eitems\u3092\/plant\u306bPOST\u3059\u308b\u3057\u304f\u307f\u3092\u3064\u304f\u308b\u3002\n<\/li>\n<li><code>resources\/views\/layouts\/app.blade.php<\/code> \u3092\u4fee\u6b63\u3057\u3066\u3001seed\u30e2\u30b8\u30e5\u30fc\u30eb\u304b\u3089plant\u30e2\u30b8\u30e5\u30fc\u30eb\u306bitems\u3092\u9001\u4fe1\u3067\u304d\u308b\u3057\u304f\u307f\u3092\u3064\u304f\u308b(Javascript)\u3002\n<\/li>\n<li><code>resources\/views\/plant\/module.blade.php<\/code> \u3092\u4fee\u6b63\u3057\u3066\u3001\u9001\u3089\u308c\u3066\u304d\u305fitems\u3092\u8868\u793a\u3059\u308b(Javascript)\u3002<\/li>\n<\/ol>\n<h4><code>resources\/views\/seed\/module.blade.php<\/code><\/h4>\n<p>x-module-nav \u306e features \u5c5e\u6027\u306b\u6e21\u3059\u914d\u5217\u306b\u3001\u4e0b\u8a18\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<div class='code'>\n<h5 class=\"source-file\">resources\/views\/seed\/module.blade.php \u306e\u4e00\u90e8<\/h5>\n<pre >\n&#039;plantation&#039; =&gt; [&#039;label&#039; =&gt; &#039;\u9262\u690d\u3048&#039;, &#039;permission&#039; =&gt; &#039;read&#039;],\n<\/pre>\n<\/div>\n<h4><code>routs\/seed.php<\/code><\/h4>\n<p>GET\u306e\u914d\u5217\u306b plantation \u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<h4><code>app\/Http\/Controllers\/SeedController.blade.php<\/code><\/h4>\n<p>plantation\u30d3\u30e5\u30fc\u3092\u8fd4\u3059\u30e1\u30bd\u30c3\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<div class='code'>\n<h5 class=\"source-file\">app\/Http\/Controllers\/SeedController.blade.php \u306e\u4e00\u90e8<\/h5>\n<pre >\n\/\/ \u7a2e\u306e\u30c7\u30fc\u30bf\u3092\u690d\u7269\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u9001\u308b\u305f\u3081\u306e\u30d5\u30a9\u30fc\u30e0\u3092\u3064\u304f\u308b\npublic function plantation(){\n  return $this-&gt;respond([\n    \/\/ seed\/plantation.blade.php\u4e2d\u3067\u3001plant\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u60c5\u5831\u304c\u5fc5\u8981\u306b\u306a\u308b\u3002\n    &#039;plant_table&#039; =&gt; new PlantTableDefinition(),\n  ]);\n}\n<\/pre>\n<\/div>\n<h4><code>resources\/views\/seed\/plantation.blade.php<\/code><\/h4>\n<p>\u8ffd\u52a0\u30c7\u30fc\u30bf\u3092json\u3067\u9001\u3063\u3066\u3001\u7d50\u679c\u3092\u53d7\u3051\u53d6\u308b\u3068\u3044\u3046\u90e8\u5206\u306f material\/create\u3068\u4f3c\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u308c\u3092\u5143\u306b\u3057\u3066\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002\n\u91cd\u8981\u306a\u90e8\u5206\u3092\u4ee5\u4e0b\u306b\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h5>x-data\u306etemplate(item)<\/h5>\n<p>\u5f15\u6570\u306eitem\u306fseed\u30c6\u30fc\u30d6\u30eb\u306e\u30c7\u30fc\u30bf\u3067\u3001\u3053\u308c\u3092 template \u3067\u51e6\u7406\u3059\u308b\u3053\u3068\u3067\u3001plant\u306e\u578b\u306b\u3059\u308b\u3002\ninit\u3067\u3001$watch\u3092\u8a2d\u5b9a\u3057\u3066\u3042\u308a\u3001\u305d\u3053\u3067items\u304b\u3089entries\u3092\u3064\u304f\u308b\u3068\u304d\u306b\u4f7f\u308f\u308c\u308b\u3002<\/p>\n<h5>x-data\u306eplantation()<\/h5>\n<p>entries\u3092plant.store\u306bpost\u3059\u308b\u3002\n\u5b9f\u969b\u306b\u3053\u308c\u3092\u547c\u3073\u51fa\u3057\u3066\u3044\u308b\u90e8\u5206\u306f\u4e00\u304b\u6240\u3060\u3051\u306a\u306e\u3067\u3001\u305d\u3061\u3089\u3067\u5b9a\u7fa9\u3057\u3066\u3082\u3088\u3044\u304c\u3001\u95a2\u6570\u5316\u3057\u3066\u304a\u304f\u3053\u3068\u3067\u3001\u52d5\u4f5c\u691c\u8a3c\u304c\u3084\u308a\u3084\u3059\u304f\u306a\u308b\u3002<\/p>\n<h5>selectModule(&#8216;plant&#8217;).then()<\/h5>\n<p>layouts\/app.blade.php\u306b\u3042\u308bselectModule\u3092\u4fee\u6b63\u3057\u3066\u3001htmx\u306b\u3088\u308bHTML\u306e\u5dee\u3057\u66ff\u3048\u304c\u7d42\u308f\u3063\u305f\u5f8c\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<p>\u65b0\u3057\u3044\u30c7\u30fc\u30bf(created)\u306fplant\u30e2\u30b8\u30e5\u30fc\u30eb\u306eitems\u306b\u8a2d\u5b9a\u3057\u305f\u3044\u304c\u3001x-data\u306e\u30b9\u30b3\u30fc\u30d7\u304c\u7570\u306a\u308b\u306e\u3067\u76f4\u63a5\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u3044\u3002\n\u305d\u3053\u3067\u3001post-plantation\u3068\u3044\u3046\u30a4\u30d9\u30f3\u30c8\u3092\u5b9a\u7fa9\u3057\u3001\u305d\u306e\u30a4\u30d9\u30f3\u30c8\u306b\u4ed8\u5c5e\u3055\u305b\u308b\u5f62\u3067created\u3092\u6e21\u3059\u3002<\/p>\n<div class='code'>\n  <h5 class=\"source-file\">resources\/views\/seed\/plantation.blade.php<\/h5>\n<pre >\n@extends(&quot;$module_id.module&quot;)\n@section(&#039;feature&#039;)\n  &lt;x-feature id=&#039;{{ $feature_id }}&#039;&gt;\n    &lt;div\n      x-data=&quot;Material.makeStorePanel({\n        required: @js($table-&gt;requiredColumns()),\n \n        \/* plant\u30c6\u30fc\u30d6\u30eb\u306b\u5408\u308f\u305b\u305f\u521d\u671f\u5024\u3092\u3064\u304f\u308b *\/\n        template(item) {\n          return {\n            ...item,\n            seed_id: item.id, \/\/ \u3053\u3053\u306eitem\u306fseed\u30c6\u30fc\u30d6\u30eb\u306e\u30ec\u30b3\u30fc\u30c9\u3002\u305d\u306eid\u3092plant\u30c6\u30fc\u30d6\u30eb\u306eseed_id\u306b\u8a2d\u5b9a\u3059\u308b\u3002\n            created_at: @js(date(&#039;ymd&#039;)),\n            owner: @js(auth()-&gt;user()-&gt;name),\n          }\n        },\n \n        plantation() {\n          \/* plant\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u8ffd\u52a0\u3059\u308b\u3002\n           *\/\n          this.store(&#039;{{ route(&quot;web.plant.store&quot;) }}&#039;)\n            .then(data =&gt; {\n              \/* \u8ffd\u52a0\u306b\u6210\u529f\u3057\u305f\u3082\u306e\u3092\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u524a\u9664\u3059\u308b console.log(&#039;succeeded ids:&#039;, Object.keys(data.succeeded));\n               *\/\n              console.log(&#039;succeeded ids:&#039;, Object.keys(data.succeeded));\n              const ids = new Set(Object.keys(data.succeeded).map(Number));\n              this.entries = this.entries.filter(entry =&gt; ! ids.has(entry.id));\n \n              \/* \u8ffd\u52a0\u306b\u6210\u529f\u3057\u305f\u3082\u306e\u306eitem.checked\u3092\u306f\u305a\u3059 console.log(&#039;succeeded ids:&#039;, Object.keys(data.succeeded));\n               *\/\n              console.log(&#039;succeeded ids:&#039;, Object.keys(data.succeeded));\n              checkedItems.forEach(item =&gt; {\n                if(ids.has(item.id)) item.checked = false;\n              });\n \n              \/* \u9262\u690d\u3048\u306b\u6210\u529f\u3057\u305f\u3082\u306e\u3092\u690d\u7269\u306e\u4e00\u89a7\u306b\u9001\u308b\n               *\/\n              const created = data.created.map(item =&gt; ({...item, checked : true}));\n              selectModule(&#039;plant&#039;).then(() =&gt; {\n                \/* Alpine.js \u5074\u306b\u30ab\u30b9\u30bf\u30e0\u30a4\u30d9\u30f3\u30c8\u3092\u9001\u4fe1\n                 *\/\n                window.dispatchEvent(new CustomEvent(&#039;post-plantation&#039;, {\n                  detail: { message: &#039;Load!&#039;, items: created }\n                }));\n              }); \/\/ selectModule().then()\u3092\u9589\u3058\u308b\n            }); \/\/ store().then()\u3092\u9589\u3058\u308b\n        }, \/\/ plantation(){} \u3092\u9589\u3058\u308b\n \n        init() {\n          this.$watch(&#039;items&#039;, (items) =&gt; {\n            this.entries = checkedItems.map((item) =&gt; this.template(item));\n          });\n        },\n      })&quot;\n    &gt;\n      @if(0)  {{-- \u52d5\u4f5c\u78ba\u8a8d\u7528\u30b3\u30fc\u30c9 --}}\n        &lt;div class=&#039;plantation-test&#039;\n          x-init=&quot;\n            query.strain.value = &#039;Colsssss&#039;;\n            search().then(() =&gt; {\n              items.slice(0, 1).map(item =&gt; item.checked = true);\n            });\n          &quot;\n        &gt;plantation-test\n          query:\n          &lt;template x-for=&quot;key in Object.keys(query)&quot; :key=&quot;key&quot;&gt;\n            &lt;template x-if=&quot;query[key] !== undefined &amp;&amp; query[key] !== &#039;&#039;&quot;&gt;\n              &lt;span x-text=&quot;key&quot;&gt;&lt;\/span&gt;=&lt;span x-text=&quot;query[key]&quot;&gt;&lt;\/span&gt;\n            &lt;\/template&gt;\n          &lt;\/template&gt;\n        &lt;\/div&gt;\n      @endif\n \n      &lt;p x-show=&quot;!hasChecked&quot; class=&quot;pb-10 pl-4&quot;&gt;\n        &lt;a\n          href=&quot;{{ route(&quot;web.$module_id.index&quot;) }}&quot;\n          @click.prevent=&quot;selectFeature(&#039;{{ &quot;${module_id}-index&quot; }}&#039;, event)&quot;\n        &gt;\n          \u5148\u306b\u30e9\u30d9\u30eb\u3092\u3064\u304f\u308b\u30b5\u30f3\u30d7\u30eb\u306b\u30c1\u30a7\u30c3\u30af\u3092\u3044\u308c\u3066\u304f\u3060\u3055\u3044\u3002\n        &lt;\/a&gt;\n      &lt;\/p&gt;\n \n    {{-- \u8868\u578b\u306e\u5165\u529b\u30d5\u30a9\u30fc\u30e0 \u7a2e\u304b\u3089\u690d\u7269\u3078\u30c7\u30fc\u30bf\u30b3\u30d4\u30fc --}}\n    &lt;div x-show=&quot;hasChecked&quot;&gt;\n      &lt;p class=&quot;pl-4&quot;&gt;\n        \u9262\u690d\u3048\u306b\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u306b\u30c1\u30a7\u30c3\u30af\u3092\u3044\u308c\u3066\u304f\u3060\u3055\u3044\u3002\n        \u300c\u7a2e\u64ad\u304d\u30fb\u9262\u690d\u3048\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u5f8c\u3067\u3001\u690d\u7269\u306e\u4e00\u89a7\u304b\u3089\u30e9\u30d9\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\n      &lt;\/p&gt;\n      &lt;p class=&quot;py-2 pl-4&quot;&gt;\u540c\u3058\u7a2e\u985e\u306e\u7a2e\u304b\u3089\u8907\u6570\u306e\u9262\u690d\u3048\u3092\u3064\u304f\u308b\u3068\u304d\u306f\u3001\u500b\u4f53\u756a\u53f7\u3092\u7de8\u96c6\u3057\u3066\u304f\u3060\u3055\u3044\u3002&lt;\/p&gt;\n      &lt;p class=&quot;py-2 pl-4&quot;&gt;\t\n        &lt;button type=&#039;submit&#039; title=&quot;\u30c1\u30a7\u30c3\u30af\u306e\u5165\u3063\u305f\u7a2e\u3092\u690d\u7269\u30ea\u30b9\u30c8\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002&quot;\n          @click=&quot;plantation()&quot;\n        &gt;\n          \u7a2e\u64ad\u304d\u30fb\u9262\u690d\u3048\n        &lt;\/button&gt;\n      &lt;\/p&gt;\n \n      &lt;table class=&#039;material-list&#039;&gt;\n        &lt;thead&gt;\n          {{-- thead 1\u884c\u76ee \u898b\u51fa\u3057 --}}\n          &lt;tr class=&#039;&#039;&gt;\n            &lt;th&gt;&lt;\/th&gt;\n            @foreach($plant_table-&gt;columns(&#039;create&#039;) as $col)\n              &lt;x-material.table-th :column=$col \/&gt;\n            @endforeach\n          &lt;\/tr&gt;\n        &lt;\/thead&gt;\n \n        &lt;tbody&gt;\n          &lt;!-- \u5bfe\u8c61\u30b5\u30f3\u30d7\u30eb --&gt;\n          &lt;template x-for=&quot;entry in entries&quot; :key=&quot;entry.id&quot;&gt;\n            &lt;tr&gt;\n              &lt;td&gt;\n                &lt;input type=&#039;checkbox&#039; checked=&#039;checked&#039;\n                  x-model=&quot;entry.checked&quot;\n                  @change=&quot;if (!entry.checked) {\n                    checkedItems.forEach(item =&gt; {if(item.id == entry.id) item.checked = false});\n                    entries = entries.filter(e =&gt; e !== entry)\n                  }&quot;\n                &gt;\n                &lt;span x-text=&quot;entry.id&quot;&gt;&lt;\/span&gt;\n              &lt;\/td&gt;\n \n              @foreach($plant_table-&gt;columns(&#039;create&#039;) as $key =&gt; $col)\n                &lt;td class=&quot;{{ $col[&#039;class&#039;] }}&quot;&gt;\n                  &lt;input x-model=&quot;entry.{{ $key }}&quot; placeholder=&quot;{{ $col[&#039;placeholder&#039;] ?? &#039;&#039; }}&quot;\n                    @focus=&quot;$el.select()&quot;\n                  &gt;\n                &lt;\/td&gt;\n              @endforeach\n              &lt;td&gt;\n                seed_id: &lt;span x-text=&quot;entry.seed_id&quot;&gt;&lt;\/span&gt;\n              &lt;\/td&gt;\n            &lt;\/tr&gt;\n          &lt;\/template&gt;\n        &lt;\/tbody&gt;\n      &lt;\/table&gt;\n    &lt;\/div&gt;\n \n&lt;\/x-feature&gt;\n@endsection\n<\/pre>\n<\/div>\n<p><\/p>\n<h4><code>resources\/views\/layouts\/app.blade.php<\/code><\/h4>\n<p>selectModule\u3092\u4fee\u6b63\u3057\u3066\u3001Promise\u3092\u8fd4\u3059\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u3059\u3067\u306b\u6307\u5b9a\u3055\u308c\u305f\u30e2\u30b8\u30e5\u30fc\u30eb\u306eHTML\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u3001Promise\u306fresolve()\u3092\u3059\u3050\u306b\u5b9f\u884c\u3057\u307e\u3059\u3002\nHTML\u304c\u306a\u304b\u3063\u305f\u5834\u5408\u3001htmx\u304c\u52d5\u304d\u3001HTML\u306e\u5dee\u3057\u8fbc\u307f\u304c\u7d42\u308f\u3063\u305f\u3042\u3068htmx:afterSettle\u30a4\u30d9\u30f3\u30c8\u3092\u767a\u706b\u3057\u307e\u3059\u3002\n\u3053\u306e\u30a4\u30d9\u30f3\u30c8\u304c\u8d77\u304d\u305f\u3068\u304d\u3001resolve()\u304c\u5b9f\u884c\u3055\u308c\u308b\u3088\u3046\u306b\u3001document.addEventListener\u3067\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3089\u306e\u5909\u66f4\u306b\u3088\u3063\u3066\u3001 selectModule(module_id).then(&#8230;) \u3068\u3044\u3046\u3088\u3046\u306b\u3057\u3066\u3001htmx\u304cHTML\u306e\u66f8\u304d\u63db\u3048\u3092\u7d42\u3048\u305f\u3068\u304d\u306b\u6b21\u306e\u30a4\u30d9\u30f3\u30c8 post-plantation \u306b\u79fb\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<div class='code'>\n  <h5 class=\"source-file\">resources\/views\/layouts\/app.blade.php<\/h5>\n<pre >\n@extends(&#039;layouts.html&#039;)\n \n@section(&#039;body&#039;)\n  &lt;header class=&#039;bg-blue-500 text-white py-2 px-2 flex justify-between items-start&#039;&gt;\n    &lt;h1 class=&#039;text-xl leading-none&#039;&gt;{{ config(&#039;app.name&#039;) }}&lt;\/h1&gt;\n    &lt;div class=&quot;flex items-baseline&quot;&gt;\n      @auth\n        &lt;span class=&#039;px-2 text-sm&#039;&gt;{{ auth()-&gt;user()-&gt;name }}&lt;\/span&gt;\n        &lt;form method=&quot;POST&quot; action=&quot;{{ route(&#039;logout&#039;) }}&quot; class=&quot;inline&quot;&gt;\n          @csrf\n          &lt;button type=&quot;submit&quot; class=&quot;text-sm text-black bg-gray-200 border-gray-400 px-2 hover:bg-gray-400 hover:text-white&quot;&gt;\n            {{ __(&#039;\u30ed\u30b0\u30a2\u30a6\u30c8&#039;) }}\n          &lt;\/button&gt;\n        &lt;\/form&gt;\n      @endauth\n      @guest\n        &lt;span class=&#039;px-2 text-sm&#039;&gt;\u30b2\u30b9\u30c8&lt;\/span&gt;\n        &lt;form method=&quot;GET&quot; action=&quot;{{ route(&#039;login&#039;) }}&quot; class=&quot;inline&quot;&gt;\n          &lt;button type=&quot;submit&quot; class=&quot;text-sm text-black bg-gray-200 border-gray-400 px-2 hover:bg-gray-400 hover:text-white&quot;&gt;\n            {{ __(&#039;\u30ed\u30b0\u30a4\u30f3&#039;) }}\n          &lt;\/button&gt;\n        &lt;\/form&gt;\n      @endguest\n    &lt;\/div&gt;\n  &lt;\/header&gt;\n \n  &lt;main id=&#039;modules&#039; class=&#039;bg-yellow-100 px-2 min-h-screen&#039;\n    x-data=&quot;{\n      activeModule: &#039;{{ $module_id }}&#039;,\n \n      \/* activeModule\u306e\u5024\u3092\u5909\u66f4\u3057\u3001\u305d\u306eHTML\u8981\u7d20\u304c\u306a\u3044\u3068\u304d\u306b\u53d6\u5f97\u3059\u308b *\/\n      selectModule(moduleId){\n        \/* \u30bf\u30d6\u306ehref\u5c5e\u6027\u304b\u3089url\u3092\u53d6\u5f97\u3059\u308b *\/\n        const tab = document.getElementById(`${moduleId}-tab`);\n        if(!tab) return;\n        const url = tab.href;\n \n        \/* URL\u3092\u5909\u66f4\u3059\u308b\u3002\u3053\u308c\u306b\u3088\u3063\u3066\u30d6\u30e9\u30a6\u30b6\u30fc\u306e\u30ea\u30ed\u30fc\u30c9\u3092\u3057\u3066\u3082\u3001\u4ee5\u524d\u306e\u30da\u30fc\u30b8\u3092\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b *\/\n        history.pushState({}, &#039;&#039;, url);\n \n        \/* activeModule\u306bid\u3092\u8a2d\u5b9a *\/\n        this.activeModule = moduleId;\n \n        return new Promise((resolve) =&gt; {\n          \/* id\u3067\u8981\u7d20\u3092\u53d6\u5f97 *\/\n          const panel = document.getElementById(moduleId);\n \n          \/* \u8981\u7d20\u3092\u53d6\u5f97\u3067\u304d\u305f\u3068\u304d\u306f resolve() \u3092\u547c\u3073\u51fa\u3059 -&gt; then\u306b\u9032\u3080 *\/\n          if(panel !== null) {\n            resolve();\n            return;\n          }\n \n          \/* \u8981\u7d20\u3092\u53d6\u5f97\u3067\u304d\u306a\u304b\u3063\u305f\u3068\u304d\u306bhtmx\u3067\u90e8\u5206HTML\u3092\u53d6\u5f97\u3059\u308b *\/\n          \n          \/\/ \u5947\u5999\u306b\u898b\u3048\u308b\u304c\u3053\u308c\u306fhander\u3068\u3044\u3046\u95a2\u6570\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u308b\u3002handler\u306frevolve()\u3092\u3059\u308b\u3060\u3051\u3002\n          const handler = () =&gt; {console.log(&#039;handler was called&#039;); resolve()};\n          \n          \/\/ htmx\u306e\u7f6e\u304d\u63db\u3048\u304c\u7d42\u308f\u3063\u305f\u3089\u3001handler\u304c\u547c\u3070\u308c\u308b(=&gt; revolve()\u3092\u5b9f\u884c\u3059\u308b)\u3002\n          document.body.addEventListener(&#039;htmx:afterSettle&#039;, handler, { once: true });\n          \n          htmx.ajax(&#039;GET&#039;, url, {\n            target:&#039;main&#039;, \/* \u53d6\u5f97\u3057\u305fHTML\u306e\u7f6e\u304d\u63db\u3048\u5834\u6240 *\/\n            swap: &#039;beforeend&#039;,  \/* \u4eca\u56de\u306fdiv.features\u306e\u5b50\u8981\u7d20\u3068\u3057\u3066\u8ffd\u52a0\u3059\u308b\u306e\u3067beforeend *\/\n            headers: {\n              &#039;HX-Target&#039;: &#039;module-&#039; + moduleId,\n            }\n          });\n        })  \/\/ return new Promise\u306e\u7d42\u308f\u308a\n      } \/\/ selectModule\u306e\u7d42\u308f\u308a\n    }&quot;\n  &gt;\n    &lt;nav class=&#039;py-2 px-2&#039;&gt;\n      &lt;ul id=&#039;module-tabs&#039; class=&#039;flex&#039;&gt;\n        @foreach([\n          {{-- bg-{{ $module_id }}\u306ftailwindcss\u304c\u898b\u9003\u3059\u306e\u3067bg-oligo\u3068\u3059\u308b --}}\n          &#039;seed&#039; =&gt; [&#039;label&#039; =&gt; &#039;\u7a2e\u5b50&#039;, &#039;active&#039; =&gt; &#039;bg-seed&#039;, &#039;inactive&#039; =&gt; &#039;hover:bg-seed-light&#039;],\n          &#039;plant&#039; =&gt; [&#039;label&#039; =&gt; &#039;\u690d\u7269&#039;, &#039;active&#039; =&gt; &#039;bg-plant&#039;, &#039;inactive&#039; =&gt; &#039;hover:bg-plant-light&#039;],\n          &#039;oligo&#039; =&gt; [&#039;label&#039; =&gt; &#039;\u30aa\u30ea\u30b4DNA&#039;, &#039;active&#039; =&gt; &#039;bg-oligo&#039;, &#039;inactive&#039; =&gt; &#039;hover:bg-oligo-light&#039;],\n        ] as $module =&gt; $info)\n          &lt;li class=&#039;module-tab&#039;\n            :class=&quot;{\n              &#039;{{ $info[&#039;active&#039;] }} text-white&#039;: activeModule === &#039;{{ $module }}&#039;,\n              &#039;{{ $info[&#039;inactive&#039;] }} bg-white text-gray-600&#039; : activeModule !== &#039;{{ $module }}&#039;\n            }&quot;\n          &gt;\n            &lt;a id=&#039;{{ $module }}-tab&#039; role=&#039;tab&#039;\n              href=&#039;{{ route(&quot;web.{$module}.index&quot;) }}&#039;\n              @click.prevent=&quot;selectModule(&#039;{{ $module }}&#039;, event)&quot;\n            &gt;\n              {{ $info[&#039;label&#039;] }}\n            &lt;\/a&gt;\n          &lt;\/li&gt;\n        @endforeach\n        &lt;li x-text=&quot;activeModule&quot; class=&#039;module-tab bg-gray-400&#039;&gt;&lt;\/li&gt;\n      &lt;\/ul&gt;\n    &lt;\/nav&gt;\n    @yield(&#039;module&#039;)\n  &lt;\/main&gt;\n@endsection\n<\/pre>\n<\/div>\n<h4><code>resources\/views\/plant\/module.blade.php<\/code><\/h4>\n<p>seed\/plantation.blade.php \u3067\u767a\u706b\u3057\u305f post-plantation \u30a4\u30d9\u30f3\u30c8\u3092\u53d7\u3051\u53d6\u308b\u3088\u3046\u306b\u4fee\u6b63\u3057\u307e\u3059\u3002\nx-on:post-plantation.window \u306falpine\u306e\u30a4\u30d9\u30f3\u30c8\u8a2d\u5b9a\u306e\u65b9\u6cd5\u3067\u3001\u30c8\u30c3\u30d7\u30ec\u30d9\u30eb\u306ewindow\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306bpost-plantation \u3068\u3044\u3046\u30a4\u30d9\u30f3\u30c8\u3092\u3068\u3089\u3048\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<div class='code'>\n  <h5 class=\"source-file\">resources\/views\/plant\/module.blade.php<\/h5>\n<pre >\n@extends(&#039;layouts.app&#039;)\n \n@section(&#039;module&#039;)\n  &lt;x-module id=&#039;{{ $module_id }}&#039;&gt;\n    &lt;!-- \u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30e1\u30cb\u30e5\u30fc --&gt;\n    &lt;x-module-nav\n      :features=&quot;[\n        &#039;index&#039; =&gt; [&#039;label&#039; =&gt; &#039;\u4e00\u89a7&#039;, &#039;permission&#039; =&gt; &#039;read&#039;],\n        &#039;label&#039; =&gt; [&#039;label&#039; =&gt; &#039;\u30e9\u30d9\u30eb&#039;, &#039;permission&#039; =&gt; &#039;read&#039;],\n        &#039;create&#039; =&gt; [&#039;label&#039; =&gt; &#039;\u8ffd\u52a0&#039;, &#039;permission&#039; =&gt; &#039;read&#039;],\n        &#039;edit&#039; =&gt; [&#039;label&#039; =&gt; &#039;\u7de8\u96c6&#039;, &#039;permission&#039; =&gt; &#039;read&#039;],\n      ]&quot;\n    \/&gt;\n    &lt;div class=&#039;features&#039;\n      x-data=&quot;Material.makeModulePanel({\n        query_template: @js($table-&gt;buildQueryDefaults()),\n        url: {\n          search: &#039;{{ route(&quot;web.{$module_id}.search&quot;) }}&#039;,\n          store: &#039;{{ route(&quot;web.$module_id.store&quot;) }}&#039;,\n          update: &#039;{{ route(&quot;web.{$module_id}.index&quot;) }}&#039;,\n        },\n      })&quot;\n      x-init=&quot;resetQuery();&quot;\n \n      {{-- seed\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u9262\u690d\u3048\u306b\u3088\u3063\u3066\u3064\u304f\u3089\u308c\u305f\u690d\u7269\u306e\u30c7\u30fc\u30bf\u3092\u8868\u793a\u3059\u308b --}}\n      x-on:post-plantation.window=&quot;\n        console.log(&#039;post-plantation event in plant\/module was called&#039;, $event.detail.items);\n        append($event.detail.items);\n      &quot;\n    &gt;\n      @yield(&#039;feature&#039;)\n    &lt;\/div&gt;\n  &lt;\/x-module&gt;\n@endsection\n<\/pre>\n<\/div>\n<h3>\u8907\u6570\u30c7\u30fc\u30bf\u306e\u8ffd\u52a0<\/h3>\n<p>\u666e\u901a\u306e\u5b9f\u9a13\u3067\u306f\u7a2e\u3092\u4e00\u3064\u64ad\u3044\u3066\u3001\u4e00\u3064\u306e\u690d\u7269\u3092\u80b2\u3066\u308b\u3068\u3044\u3046\u3053\u3068\u306f\u306a\u304f\u3001\u305f\u304f\u3055\u3093\u64ad\u3044\u3066\u3001\u305d\u306e\u4e2d\u304b\u3089\u9078\u3093\u3060\u3082\u306e\u3092\u9262\u690d\u3048\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u500b\u4f53\u756a\u53f7\u3060\u3051\u304c\u7570\u306a\u308b\u3082\u306e\u3092\u4e00\u5ea6\u306b\u767b\u9332\u3067\u304d\u308b\u3088\u3046\u306b PlantService \u306e\u6a5f\u80fd\u3092\u62e1\u5f35\u3057\u307e\u3059\u3002\u540c\u3058\u3082\u306e\u306f SeedService \u306a\u3069\u3067\u3082\u5fc5\u8981\u306b\u306a\u308b\u306e\u3067\u3001Trait\u3068\u3057\u3066\u3064\u304f\u308a\u307e\u3059\u3002<\/p>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">app\/Traits\/ExpandItem.php<\/h5>\n<pre >\n&lt;?php\n \nnamespace App\\Traits;\n \ntrait ExpandItem\n{\n    \/**\n     * $items \u914d\u5217\u306e\u6307\u5b9a\u3057\u305f $field (\u4f8b: &#039;no&#039;) \u3092\u5c55\u958b\u3057\u3001$items \u306e\u8981\u7d20\u3092\u5897\u3084\u3057\u3066\u8fd4\u3059\n     *\/\n    public function expandItems(array $items, string $field = &#039;no&#039;): array\n    {\n        $expandedItems = [];\n \n        foreach ($items as $item) {\n            \/\/ \u6307\u5b9a\u3055\u308c\u305f\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u5b58\u5728\u3057\u306a\u3044\u3001\u307e\u305f\u306f\u7a7a\u306a\u3089\u305d\u306e\u307e\u307e\u8ffd\u52a0\n            if (empty($item[$field])) {\n                $expandedItems[] = $item;\n                continue;\n            }\n \n            \/\/ no \u306a\u3069\u3092\u5206\u89e3\u3057\u3066\u8907\u6570\u306e\u6587\u5b57\u5217\u914d\u5217\uff08\u4f8b: [&#039;A-1&#039;, &#039;A-2&#039;, &#039;A-3&#039;]\uff09\u3092\u53d6\u5f97\n            $expandedNos = $this-&gt;expandNo($item[$field]);\n \n            \/\/ \u5206\u89e3\u3055\u308c\u305f no \u3054\u3068\u306b $item \u3092\u8907\u88fd\u3057\u3066\u8ffd\u52a0\n            foreach ($expandedNos as $no) {\n                $item[$field] = $no; \/\/ &#039;no&#039; \u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u66f8\u304d\u63db\u3048\n                $expandedItems[] = $item;\n            }\n        }\n \n        return $expandedItems;\n    }\n \n    \/**\n     * \u30ab\u30f3\u30de\u533a\u5207\u308a\u3084\u7bc4\u56f2\u6307\u5b9a (A1:3 \u306a\u3069) \u306e\u6587\u5b57\u5217\u3092\u5206\u89e3\u3059\u308b\n     *\/\n    public function expandNo(string $no): array\n    {\n        $base = &#039;&#039;;\n        $series = [];\n        \n        foreach (explode(&#039;,&#039;, $no) as $part) {\n            $part = trim($part);\n            if (preg_match(&quot;\/^(.*?)(\\d+)(:?)(\\d+)?$\/&quot;, $part, $match)) {\n                $base = empty($match[1]) ? $base : $match[1];\n                $start = (int)$match[2];\n                $range = isset($match[4]) ? range($start, (int)$match[4]) : [$start];\n \n                $series = array_merge($series, array_map(fn($i) =&gt; $base . $i, $range));\n            } else {\n                $series[] = $part;\n            }\n        }\n \n        return $series;\n    }\n}\n<\/pre>\n<\/div>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">app\/Services\/PlantService.php<\/h5>\n<pre >\n&lt;?php\n \nnamespace App\\Services;\n \nuse App\\Models\\Plant;\nuse App\\TableDefinitions\\PlantTableDefinition;\nuse App\\TableSearch\\SearchFactory;\nuse App\\Traits\\ExpandItem;  \/\/ \u500b\u4f53\u756a\u53f7 #1:4,6 \u3092 #1, #2, #3, #4, #6\u306b\u5c55\u958b\n \nclass PlantService extends MaterialService\n{\n    public function __construct(\n        protected Plant $model,\n        public PlantTableDefinition $table,\n        protected SearchFactory $searchFactory\n    ){}\n \n    use ExpandItem;\n \n    public function create(array $items)\n    {\n        $expandedItems = $this-&gt;expandItems($items, &#039;no&#039;);\n        return parent::create($expandedItems);\n    }\n}\n<\/pre>\n<\/div>\n<h2>\u690d\u7269\u304b\u3089\u7a2e\u5b50\u3078<\/h2>\n<p>\u9262\u306b\u690d\u3048\u305f\u690d\u7269\u304b\u3089\u7a2e\u3092\u56de\u53ce\u3057\u307e\u3059\u3002\n\u305d\u306e\u3068\u304d\u3001\u4e16\u4ee3\u756a\u53f7\u3092\u4e00\u3064\u5897\u3084\u3057\u307e\u3059\u3002\n\u307e\u305f\u3001\u690d\u7269\u306f\u67af\u308c\u3066\u3044\u308b\u3067\u3057\u3087\u3046\u304b\u3089\u3001\u540c\u6642\u306b\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u524a\u9664\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306e\u624b\u9806\u3067harvest\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u307e\u3059\u3002<\/p>\n<p><\/p>\n<ol>\n<li><code>resources\/views\/plant\/module.blade.php<\/code> \u306b\u300c\u53ce\u7a6b\u300d\u306e\u30bf\u30d6\u3092\u8ffd\u52a0\u3059\u308b\u3002\n<\/li>\n<li><code>routs\/plant.php<\/code> \u306b \/plant\/harvest \u3078\u306e\u30eb\u30fc\u30c8\u3092\u8ffd\u52a0\u3059\u308b\u3002\n<\/li>\n<li><code>app\/Http\/Controllers\/PlantController.blade.php<\/code> \u306b harvest \u306e\u30d3\u30e5\u30fc\u3092\u8fd4\u3059\u30e1\u30bd\u30c3\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3002\n<\/li>\n<li><code>resources\/views\/plant\/harvest.blade.php<\/code> \u3092\u3064\u304f\u3063\u3066\u3001plant\u30e2\u30b8\u30e5\u30fc\u30eb\u306eitems\u3092\/seed\u306bPOST\u3059\u308b\u3057\u304f\u307f\u3092\u3064\u304f\u308b\u3002\n<\/li>\n<li><code>resources\/views\/seed\/module.blade.php<\/code> \u3092\u4fee\u6b63\u3057\u3066\u3001\u9001\u3089\u308c\u3066\u304d\u305fitems\u3092\u8868\u793a\u3059\u308b(Javascript)\u3002<\/li>\n<\/ol>\n<h4><code>resources\/views\/plant\/module.blade.php<\/code><\/h4>\n<p>x-module-nav \u306e features \u5c5e\u6027\u306b\u6e21\u3059\u914d\u5217\u306b\u3001\u4e0b\u8a18\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<div class='code'>\n<h5 class=\"source-file\">resources\/views\/plant\/module.blade.php \u306e\u4e00\u90e8<\/h5>\n<pre >\n&#039;harvest&#039; =&gt; [&#039;label&#039; =&gt; &#039;\u53ce\u7a6b&#039;, &#039;permission&#039; =&gt; &#039;read&#039;],\n<\/pre>\n<\/div>\n<h4><code>routs\/plant.php<\/code><\/h4>\n<p>GET\u306e\u914d\u5217\u306b harvest \u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<h4><code>app\/Http\/Controllers\/PlantController.blade.php<\/code><\/h4>\n<p>harvest\u30d3\u30e5\u30fc\u3092\u8fd4\u3059\u30e1\u30bd\u30c3\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<div class='code'>\n<h5 class=\"source-file\">app\/Http\/Controllers\/PlantController.blade.php \u306e\u4e00\u90e8<\/h5>\n<pre >\n\/\/ \u690d\u7269\u306e\u30c7\u30fc\u30bf\u3092\u7a2e\u5b50\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u9001\u308b\u305f\u3081\u306e\u30d5\u30a9\u30fc\u30e0\u3092\u3064\u304f\u308b\npublic function harvest(){\n  return $this-&gt;respond([\n    \/\/ plant\/harvest.blade.php\u4e2d\u3067\u3001seed\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u60c5\u5831\u304c\u5fc5\u8981\u306b\u306a\u308b\u3002\n    &#039;seed_table&#039; =&gt; new SeedTableDefinition(),\n  ]);\n}\n<\/pre>\n<\/div>\n<h4><code>resources\/views\/plant\/harvest.blade.php<\/code><\/h4>\n<p>seed\/plantation.blade.php \u3092\u5143\u306b\u3057\u3066\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002\n\u91cd\u8981\u306a\u90e8\u5206\u3092\u4ee5\u4e0b\u306b\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h5>x-data\u306etemplate(item)<\/h5>\n<p>\u5f15\u6570\u306eitem\u306egeneration\u306e\u6570\u5b57\u90e8\u5206\u30921\u5897\u3084\u3057\u3066\u3001plant\u306e\u521d\u671f\u5024\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h5>selectModule(&#8216;seed&#8217;).then()<\/h5>\n<p>\u53ce\u7a6b\u5f8c\u306b\u30c7\u30fc\u30bf\u3092\u524a\u9664\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u5bfe\u3059\u308b\u51e6\u7406\u3092\u5b9f\u88c5\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u524a\u9664\u306f\u8907\u6570\u306eid\u3092\u914d\u5217\u3067\u9001\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002\n\u3068\u308a\u3042\u3048\u305a\u5fc5\u8981\u306a\u306e\u306f plant \u30e2\u30b8\u30e5\u30fc\u30eb\u3060\u3051\u3067\u3059\u304c\u3001\u4ed6\u3067\u3082\u5fc5\u8981\u306b\u306a\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u306e\u3067MaterialController\u3068MaterialService\u306b\u5b9f\u88c5\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>seed\u30e2\u30b8\u30e5\u30fc\u30eb\u306eitems\u306bcreated\u3092\u8a2d\u5b9a\u3057\u305f\u3044\u306e\u3067\u3001plantation\u3068\u540c\u3058\u3088\u3046\u306b post-harvest\u30a4\u30d9\u30f3\u30c8\u3092\u3064\u304f\u308a\u307e\u3057\u305f\u3002<\/p>\n<div class='code'>\n  <h5 class=\"source-file\">resources\/views\/plant\/harvest.blade.php<\/h5>\n<pre >\n@extends(&quot;$module_id.module&quot;)\n@section(&#039;feature&#039;)\n  &lt;x-feature id=&#039;{{ $feature_id }}&#039;&gt;\n    &lt;div\n      x-data=&quot;Material.makeStorePanel({\n        required: @js($table-&gt;requiredColumns()),\n        template(item) {\n          const match = (item.generation || &#039;&#039;).match(\/^(.*?)(\\d+)$\/);\n          const g = match ? match[1] + (parseInt(match[2]) + 1) : item.generation;\n \n          return {\n            ...item,\n            mother: item.id,\n            generation: g,\n            created_at: @js(date(&#039;ymd&#039;)),\n            owner: @js(auth()-&gt;user()-&gt;name),\n          }\n        },\n        discard: true,\n \n        harvest() {\n          this.store(&#039;{{ route(&quot;web.seed.store&quot;) }}&#039;)\n            .then(data =&gt; {\n              \/* 1. \u6210\u529f\u3057\u305f\u3082\u306e(seed_id)\u3092index (items), plantation (rows) \u8868\u304b\u3089\u524a\u9664\u3059\u308b\u3002\n               * 2. \u6210\u529f\u3057\u305f\u3082\u306e\u3092\u30c1\u30a7\u30c3\u30af\u3092\u3064\u3051\u3066\u3001plant \u306b\u9001\u308b\n               *\/\n              \/\/ \u8ffd\u52a0\u306b\u6210\u529f\u3057\u305f\u3082\u306e\u3092\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u524a\u9664\u3059\u308b \n              const ids = new Set(Object.keys(data.succeeded).map(Number));\n              this.entries = this.entries.filter(entry =&gt; ! ids.has(entry.id));\n \n              \/\/ \u8ffd\u52a0\u306b\u6210\u529f\u3057\u305f\u3082\u306e\u306eitem.checked\u3092\u306f\u305a\u3059 console.log(&#039;checkoff ids:&#039;, ids);\n              checkedItems.forEach(item =&gt; {\n                if(ids.has(item.id)) item.checked = false;\n              });\n \n              \/\/ \u8ffd\u52a0\u306b\u6210\u529f\u3057\u305f\u3082\u306e\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u524a\u9664\u3059\u308b\n              console.log(&#039;destroy&#039;, ids);\n              this.destroy(&#039;{{ route(&quot;web.$module_id.destroy&quot;)}}&#039;, Array.from(ids));\n \n              \/*  \u7a2e\u63a1\u308a\u306b\u6210\u529f\u3057\u305f\u3082\u306e\u3092\u7a2e\u5b50\u306e\u4e00\u89a7\u306b\u9001\u308b  *\/\n              const created = data.created.map(item =&gt; ({...item, checked : true}));\n              selectModule(&#039;seed&#039;).then(() =&gt; {\n                \/\/ Alpine.js \u5074\u306b\u30ab\u30b9\u30bf\u30e0\u30a4\u30d9\u30f3\u30c8\u3092\u9001\u4fe1\n                window.dispatchEvent(new CustomEvent(&#039;post-harvest&#039;, {\n                  detail: { message: &#039;Load!&#039;, items: created }\n                }));\n              }); \/\/ selectModule().then()\u3092\u9589\u3058\u308b\n            }); \/\/ store().then()\u3092\u9589\u3058\u308b\n        }, \/\/ harvest(){} \u3092\u9589\u3058\u308b\n \n        init() {\n          this.$watch(&#039;items&#039;, (items) =&gt; {\n            this.entries = checkedItems.map((item) =&gt; this.template(item));\n          });\n        },\n      })&quot;\n    &gt;\n      @if(0)  {{-- \u30c7\u30d0\u30c3\u30b0\u7528\u30b3\u30fc\u30c9 --}}\n        &lt;div class=&#039;harvest-test&#039;\n          x-init=&quot;\n            query.strain.value = &#039;Col&#039;;\n            search().then(() =&gt; {\n              items.map(item =&gt; item.checked = true);\n            });\n          &quot;\n        &gt;harvest-test\n          query:\n          &lt;template x-for=&quot;key in Object.keys(query)&quot; :key=&quot;key&quot;&gt;\n            &lt;template x-if=&quot;query[key] !== undefined &amp;&amp; query[key] !== &#039;&#039;&quot;&gt;\n              &lt;span x-text=&quot;key&quot;&gt;&lt;\/span&gt;=&lt;span x-text=&quot;query[key]&quot;&gt;&lt;\/span&gt;\n            &lt;\/template&gt;\n          &lt;\/template&gt;\n        &lt;\/div&gt;\n      @endif\n \n      &lt;p x-show=&quot;!hasChecked&quot; class=&quot;pb-10 pl-4&quot;&gt;\n        &lt;a\n          href=&quot;{{ route(&quot;web.$module_id.index&quot;) }}&quot;\n          @click.prevent=&quot;selectFeature(&#039;{{ &quot;${module_id}-index&quot; }}&#039;, event)&quot;\n        &gt;\n          \u5148\u306b\u30e9\u30d9\u30eb\u3092\u3064\u304f\u308b\u30b5\u30f3\u30d7\u30eb\u306b\u30c1\u30a7\u30c3\u30af\u3092\u3044\u308c\u3066\u304f\u3060\u3055\u3044\u3002\n        &lt;\/a&gt;\n      &lt;\/p&gt;\n \n    {{-- \u8868\u578b\u306e\u5165\u529b\u30d5\u30a9\u30fc\u30e0 \u690d\u7269\u304b\u3089\u7a2e\u5b50\u3078\u30c7\u30fc\u30bf\u30b3\u30d4\u30fc --}}\n    &lt;div x-show=&quot;hasChecked&quot;&gt;\n      &lt;p class=&quot;pl-4&quot;&gt;\n        \u7a2e\u63a1\u308a\u3092\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u306b\u30c1\u30a7\u30c3\u30af\u3092\u3044\u308c\u3066\u304f\u3060\u3055\u3044\u3002\n        \u300c\u7a2e\u63a1\u308a\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u5f8c\u3067\u3001\u7a2e\u5b50\u306e\u4e00\u89a7\u304b\u3089\u30e9\u30d9\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\n      &lt;\/p&gt;\n      &lt;p class=&quot;py-2 pl-4&quot;&gt;\u540c\u3058\u690d\u7269\u306e\u7a2e\u3092\u8907\u6570\u306e\u888b\u306b\u5206\u3051\u308b\u3068\u304d\u306f\u3001\u500b\u4f53\u756a\u53f7\u3092\u7de8\u96c6\u3057\u3066\u304f\u3060\u3055\u3044\u3002&lt;\/p&gt;\n      &lt;p class=&quot;py-2 pl-4&quot;&gt;\t\n        &lt;button type=&#039;submit&#039; title=&quot;\u30c1\u30a7\u30c3\u30af\u306e\u5165\u3063\u305f\u690d\u7269\u3092\u7a2e\u5b50\u30ea\u30b9\u30c8\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002&quot;\n          @click=&quot;harvest()&quot;\n        &gt;\n          \u7a2e\u63a1\u308a\n        &lt;\/button&gt;\n        \n        &lt;label&gt;\n          &lt;input type=&#039;checkbox&#039; x-model=&#039;discard&#039;&gt;\n          \u7a2e\u5b50\u3092\u8ffd\u52a0\u5f8c\u690d\u7269\u3092\u524a\u9664\u3059\u308b\n        &lt;\/label&gt;\n      &lt;\/p&gt;\n \n      &lt;table class=&#039;material-list&#039;&gt;\n        &lt;thead&gt;\n          {{-- thead 1\u884c\u76ee \u898b\u51fa\u3057 --}}\n          &lt;tr class=&#039;&#039;&gt;\n            &lt;th&gt;&lt;\/th&gt;\n            @foreach($seed_table-&gt;columns(&#039;create&#039;) as $col)\n              &lt;x-material.table-th :column=$col \/&gt;\n            @endforeach\n          &lt;\/tr&gt;\n        &lt;\/thead&gt;\n \n        &lt;tbody&gt;\n          &lt;!-- \u5bfe\u8c61\u30b5\u30f3\u30d7\u30eb --&gt;\n          &lt;template x-for=&quot;entry in entries&quot; :key=&quot;entry.id&quot;&gt;\n            &lt;tr&gt;\n              &lt;td&gt;\n                &lt;input type=&#039;checkbox&#039; checked=&#039;checked&#039;\n                  x-model=&quot;entry.checked&quot;\n                  @change=&quot;if (!entry.checked) {\n                    checkedItems.forEach(item =&gt; {if(item.id == entry.id) item.checked = false});\n                    entries = entries.filter(e =&gt; e !== entry)\n                  }&quot;\n                &gt;\n                &lt;span x-text=&quot;entry.id&quot;&gt;&lt;\/span&gt;\n              &lt;\/td&gt;\n \n              @foreach($seed_table-&gt;columns(&#039;create&#039;) as $key =&gt; $col)\n                &lt;td class=&quot;{{ $col[&#039;class&#039;] }}&quot;&gt;\n                  &lt;input x-model=&quot;entry.{{ $key }}&quot; placeholder=&quot;{{ $col[&#039;placeholder&#039;] ?? &#039;&#039; }}&quot;\n                    @focus=&quot;$el.select()&quot;\n                  &gt;\n                &lt;\/td&gt;\n              @endforeach\n              &lt;td&gt;\n                mother: &lt;span x-text=&quot;entry.mother&quot;&gt;&lt;\/span&gt;\n              &lt;\/td&gt;\n            &lt;\/tr&gt;\n          &lt;\/template&gt;\n        &lt;\/tbody&gt;\n      &lt;\/table&gt;\n    &lt;\/div&gt;\n \n&lt;\/x-feature&gt;\n@endsection\n<\/pre>\n<\/div>\n<h4><code>resources\/views\/seed\/module.blade.php<\/code><\/h4>\n<p>div.features \u306b\u8ffd\u52a0<\/p>\n<div class='code'>\n<h5 class=\"source-file\">resources\/views\/seed\/module.blade.php \u306e\u4e00\u90e8<\/h5>\n<pre >\n{{-- plant\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u53ce\u7a6b\u306b\u3088\u3063\u3066\u3064\u304f\u3089\u308c\u305f\u7a2e\u5b50\u306e\u30c7\u30fc\u30bf\u3092\u8868\u793a\u3059\u308b --}}\nx-on:post-harvest.window=&quot;\n  console.log(&#039;post-harvest event in seed\/module was called&#039;, $event.detail.items);\n  append($event.detail.items);\n&quot;\n<\/pre>\n<\/div>\n<h3>\u30c7\u30fc\u30bf\u524a\u9664\u306e\u5b9f\u88c5<\/h3>\n<p>id\u306e\u914d\u5217\u306fCSV\u306e\u51fa\u529b\u3067\u3064\u304f\u3063\u305f BulkItemIdsRequest \u3092\u305d\u306e\u307e\u307e\u4f7f\u3046\u3002<\/p>\n<div class='code'>\n<h5 class=\"source-file\">app\/Http\/Controllers\/MaterialController.php \u306e\u4e00\u90e8<\/h5>\n<pre >\n\/\/ \u524a\u9664\npublic function destroy(BulkItemIdsRequest $request){\n  try{\n    return $this-&gt;json($this-&gt;service-&gt;destroy($request-&gt;validated(&#039;id&#039;)), 200);\n  }catch(\\Throwable $e){\n    return $this-&gt;json([&#039;message&#039; =&gt; $e-&gt;getMessage()], 400);\n  }\n}\n<\/pre>\n<\/div>\n<div class='code'>\n<h5 class=\"source-file\">app\/Services\/MaterialService.php \u306e\u4e00\u90e8<\/h5>\n<pre >\n\/\/ \u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30ec\u30b3\u30fc\u30c9\u3092\u524a\u9664\u3059\u308b\nfunction destroy(array $ids){\n  return [&#039;destroid_items&#039; =&gt; $this-&gt;model-&gt;destroy($ids)]; \/\/ \u524a\u9664\u3055\u308c\u305f\u4ef6\u6570\u304c\u8fd4\u308b\n}\n<\/pre>\n<\/div>\n<h2>\u4ea4\u914d\u3057\u3066\u7a2e\u5b50\u3078<\/h2>\n<p>\u4ea4\u914d\u306b\u4f7f\u3063\u305f\u89aa\u682a\u306e\u60c5\u5831\u3092mother\u3068father\u306b\u3044\u308c\u3066\u3001\u7a2e\u5b50\u306e\u30c7\u30fc\u30bf\u3092\u3064\u304f\u308c\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u6a5f\u80fd\u3092\u8ffd\u52a0\u3059\u308b\u624b\u9806\u306f harvest \u3068\u307b\u307c\u540c\u3058\u3067\u3059\u3002<\/p>\n<p><\/p>\n<h4><code>resources\/views\/plant\/module.blade.php<\/code><\/h4>\n<p>x-module-nav \u306e features \u5c5e\u6027\u306b\u6e21\u3059\u914d\u5217\u306b\u3001\u4e0b\u8a18\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<div class='code'>\n<h5 class=\"source-file\">resources\/views\/plant\/module.blade.php \u306e\u4e00\u90e8<\/h5>\n<pre >\n&#039;cross&#039; =&gt; [&#039;label&#039; =&gt; &#039;\u4ea4\u914d&#039;, &#039;permission&#039; =&gt; &#039;read&#039;],\n<\/pre>\n<\/div>\n<h4><code>routs\/plant.php<\/code><\/h4>\n<p>GET\u306e\u914d\u5217\u306b cross \u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<h4><code>app\/Http\/Controllers\/PlantController.blade.php<\/code><\/h4>\n<p>cross\u30d3\u30e5\u30fc\u3092\u8fd4\u3059\u30e1\u30bd\u30c3\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<div class='code'>\n<h5 class=\"source-file\">app\/Http\/Controllers\/PlantController.blade.php \u306e\u4e00\u90e8<\/h5>\n<pre >\n\/\/ \u690d\u7269\u306e\u30c7\u30fc\u30bf\u3092\u7a2e\u5b50\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u9001\u308b\u305f\u3081\u306e\u30d5\u30a9\u30fc\u30e0\u3092\u3064\u304f\u308b\npublic function cross(){\n  return $this-&gt;respond([\n    &#039;seed_table&#039; =&gt; new SeedTableDefinition(),\n  ]);\n}\n<\/pre>\n<\/div>\n<h4><code>resources\/views\/plant\/cross.blade.php<\/code><\/h4>\n<p>plant\/cross.blade.php \u3092\u5143\u306b\u3057\u3066\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002\n\u91cd\u8981\u306a\u90e8\u5206\u3092\u4ee5\u4e0b\u306b\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h5>table &#8211; tbody &#8211; td \u96c4\u96cc\u306eselect<\/h5>\n<p>\u30c1\u30a7\u30c3\u30af\u304c\u4ed8\u3044\u305fitem\u304b\u3089 template \u3092\u4f7f\u3063\u3066 select\u30dc\u30c3\u30af\u30b9\u3092\u4f5c\u308a\u307e\u3059\u3002\nx-model\u3067entry\u306emother\u3068father\u3092\u6307\u5b9a\u3057\u3001option\u306evalue\u3092\u305d\u308c\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<div class='code'>\n  <h5 class=\"source-file\">resources\/views\/plant\/cross.blade.php<\/h5>\n<pre >\n@extends(&quot;$module_id.module&quot;)\n@section(&#039;feature&#039;)\n  &lt;x-feature id=&#039;{{ $feature_id }}&#039;&gt;\n    &lt;div\n      x-data=&quot;Material.makeStorePanel({\n        required: @js($table-&gt;requiredColumns()),\n        template(item) {\n          return {\n            ...item,\n            mother: 0,\n            father: 0,\n            generation: &#039;F1&#039;,\n            create_at: @js(date(&#039;ymd&#039;)),\n            owner: @js(auth()-&gt;user()-&gt;name),\n          }\n        },\n        discard: true,\n \n        cross() {\n          this.store(&#039;{{ route(&quot;web.seed.store&quot;) }}&#039;)\n            .then(data =&gt; {\n              console.log(&#039;after cross:&#039;, data, checkedItems);\n              \/* 1. \u6210\u529f\u3057\u305f\u3082\u306e(seed_id)\u3092index (items), plantation (rows) \u8868\u304b\u3089\u524a\u9664\u3059\u308b\u3002\n                * 2. \u6210\u529f\u3057\u305f\u3082\u306e\u3092\u30c1\u30a7\u30c3\u30af\u3092\u3064\u3051\u3066\u3001plant \u306b\u9001\u308b\n                *\/\n              \/\/ \u8ffd\u52a0\u306b\u6210\u529f\u3057\u305f\u3082\u306e\u3092\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u524a\u9664\u3059\u308b \n              console.log(&#039;succeeded ids:&#039;, Object.keys(data.succeeded));\n              const ids = new Set(Object.keys(data.succeeded).map(Number));\n              this.entries = this.entries.filter(entry =&gt; ! ids.has(entry.id));\n \n              \/\/ \u8ffd\u52a0\u306b\u6210\u529f\u3057\u305f\u3082\u306e\u306eitem.checked\u3092\u306f\u305a\u3059\n              console.log(&#039;checkoff ids:&#039;, ids);\n              checkedItems.forEach(item =&gt; {\n                if(ids.has(item.id)) item.checked = false;\n              });\n \n              \/\/ \u8ffd\u52a0\u306b\u6210\u529f\u3057\u305f\u3082\u306e\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u524a\u9664\u3059\u308b\n              console.log(&#039;destroy&#039;, ids);\n              this.destroy(&#039;{{ route(&quot;web.$module_id.destroy&quot;)}}&#039;, Array.from(ids));\n \n              \/*  \u7a2e\u63a1\u308a\u306b\u6210\u529f\u3057\u305f\u3082\u306e\u3092\u7a2e\u5b50\u306e\u4e00\u89a7\u306b\u9001\u308b  *\/\n              const created = data.created.map(item =&gt; ({...item, checked : true}));\n              selectModule(&#039;seed&#039;).then(() =&gt; {\n                \/\/ Alpine.js \u5074\u306b\u30ab\u30b9\u30bf\u30e0\u30a4\u30d9\u30f3\u30c8\u3092\u9001\u4fe1\n                window.dispatchEvent(new CustomEvent(&#039;post-cross&#039;, {\n                  detail: { message: &#039;Load!&#039;, items: created }\n                }));\n              }); \/\/ selectModule().then()\u3092\u9589\u3058\u308b\n            }); \/\/ store().then()\u3092\u9589\u3058\u308b\n        }, \/\/ cross(){} \u3092\u9589\u3058\u308b\n \n        init() {\n          this.$watch(&#039;items&#039;, (items) =&gt; {\n            this.entries = checkedItems.map((item) =&gt; this.template(item));\n          });\n        },\n      })&quot;\n    &gt;\n      @if(1)\n        &lt;div class=&#039;cross-test&#039;\n          x-init=&quot;\n            query.strain.value = &#039;Col&#039;;\n            search().then(() =&gt; {\n              items.map(item =&gt; item.checked = true);\n            });\n          &quot;\n        &gt;cross-test\n          query:\n          &lt;template x-for=&quot;key in Object.keys(query)&quot; :key=&quot;key&quot;&gt;\n            &lt;template x-if=&quot;query[key] !== undefined &amp;&amp; query[key] !== &#039;&#039;&quot;&gt;\n              &lt;span x-text=&quot;key&quot;&gt;&lt;\/span&gt;=&lt;span x-text=&quot;query[key]&quot;&gt;&lt;\/span&gt;\n            &lt;\/template&gt;\n          &lt;\/template&gt;\n        &lt;\/div&gt;\n      @endif\n \n      &lt;p x-show=&quot;!hasChecked&quot; class=&quot;pb-10 pl-4&quot;&gt;\n        &lt;a\n          href=&quot;{{ route(&quot;web.$module_id.index&quot;) }}&quot;\n          @click.prevent=&quot;selectFeature(&#039;{{ &quot;${module_id}-index&quot; }}&#039;, event)&quot;\n        &gt;\n          \u5148\u306b\u4ea4\u914d\u306b\u4f7f\u7528\u3057\u305f\u89aa\u690d\u7269\u306b\u30c1\u30a7\u30c3\u30af\u3092\u3044\u308c\u3066\u304f\u3060\u3055\u3044\u3002\n        &lt;\/a&gt;\n      &lt;\/p&gt;\n \n    {{-- \u8868\u578b\u306e\u5165\u529b\u30d5\u30a9\u30fc\u30e0 \u690d\u7269\u304b\u3089\u7a2e\u5b50\u3078\u30c7\u30fc\u30bf\u30b3\u30d4\u30fc --}}\n    &lt;div x-show=&quot;hasChecked&quot;&gt;\n      &lt;p class=&quot;pl-4&quot;&gt;\n        \u7a2e\u63a1\u308a\u3092\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u306b\u30c1\u30a7\u30c3\u30af\u3092\u3044\u308c\u3066\u304f\u3060\u3055\u3044\u3002\n        \u300c\u7a2e\u63a1\u308a\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u5f8c\u3067\u3001\u7a2e\u5b50\u306e\u4e00\u89a7\u304b\u3089\u30e9\u30d9\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\n      &lt;\/p&gt;\n      &lt;p class=&quot;py-2 pl-4&quot;&gt;\u540c\u3058\u690d\u7269\u306e\u7a2e\u3092\u8907\u6570\u306e\u888b\u306b\u5206\u3051\u308b\u3068\u304d\u306f\u3001\u500b\u4f53\u756a\u53f7\u3092\u7de8\u96c6\u3057\u3066\u304f\u3060\u3055\u3044\u3002&lt;\/p&gt;\n      &lt;p class=&quot;py-2 pl-4&quot;&gt;\t\n        &lt;button type=&#039;submit&#039; title=&quot;\u30c1\u30a7\u30c3\u30af\u306e\u5165\u3063\u305f\u690d\u7269\u3092\u7a2e\u5b50\u30ea\u30b9\u30c8\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002&quot;\n          @click=&quot;cross()&quot;\n        &gt;\n          \u4ea4\u914d\u3057\u305f\u7a2e\u5b50\u3092\u767b\u9332\n        &lt;\/button&gt;\n        \n        &lt;label&gt;\n          &lt;input type=&#039;checkbox&#039; x-model=&#039;discard&#039;&gt;\n          \u7a2e\u5b50\u3092\u8ffd\u52a0\u5f8c\u690d\u7269\u3092\u524a\u9664\u3059\u308b\n        &lt;\/label&gt;\n      &lt;\/p&gt;\n \n      &lt;table class=&#039;material-list&#039;&gt;\n        &lt;thead&gt;\n          {{-- thead 1\u884c\u76ee \u898b\u51fa\u3057 --}}\n          &lt;tr class=&#039;&#039;&gt;\n            &lt;th&gt;&lt;\/th&gt;\n            &lt;th&gt;\u96cc (\u2640)&lt;\/th&gt;\n            &lt;th&gt;\u96c4 (\u2642)&lt;\/th&gt;\n            @foreach($seed_table-&gt;columns(&#039;create&#039;) as $col)\n              &lt;x-material.table-th :column=$col \/&gt;\n            @endforeach\n          &lt;\/tr&gt;\n        &lt;\/thead&gt;\n \n        &lt;tbody&gt;\n          &lt;!-- \u5bfe\u8c61\u30b5\u30f3\u30d7\u30eb --&gt;\n          &lt;template x-for=&quot;entry in entries&quot; :key=&quot;entry.id&quot;&gt;\n            &lt;tr&gt;\n              &lt;td&gt;\n                &lt;input type=&#039;checkbox&#039; checked=&#039;checked&#039;\n                  x-model=&quot;entry.checked&quot;\n                  @change=&quot;if (!entry.checked) {\n                    checkedItems.forEach(item =&gt; {if(item.id == entry.id) item.checked = false});\n                    entries = entries.filter(e =&gt; e !== entry)\n                  }&quot;\n                &gt;\n                &lt;span x-text=&quot;entry.id&quot;&gt;&lt;\/span&gt;\n              &lt;\/td&gt;\n \n              {{-- \u96cc\u3057\u3079\u5074\u9078\u629e --}}\n              &lt;td&gt;\n                &lt;select x-model=&quot;entry.mother&quot;\n                  @change=&quot;\n                    if($event.target.value == 0) return;\n                    const selected = checkedItems.find(item =&gt; item.id == $event.target.value);\n                    entry.strain = selected.strain;\n                  &quot;\n                &gt;\n                  &lt;option value=&quot;0&quot;&gt;\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044&lt;\/option&gt;\n                  &lt;template x-for=&quot;parent in checkedItems&quot; :key=&quot;parent.id&quot;&gt;\n                    &lt;option :value=&quot;parent.id&quot; x-text=&quot;[parent.strain, parent.generation, parent.no].join(&#039; &#039;)&quot; \/&gt;\n                  &lt;\/template&gt;\n                &lt;\/select&gt;\n              &lt;\/td&gt;\n \n              {{-- \u96c4\u3057\u3079\u5074\u9078\u629e --}}\n              &lt;td&gt;\n                &lt;select x-model=&quot;entry.father&quot;&gt;\n                  &lt;option value=&quot;0&quot;&gt;\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044&lt;\/option&gt;\n                  &lt;template x-for=&quot;parent in checkedItems&quot; :key=&quot;parent.id&quot;&gt;\n                    &lt;option :value=&quot;parent.id&quot; x-text=&quot;[parent.strain, parent.generation, parent.no].join(&#039; &#039;)&quot; \/&gt;\n                  &lt;\/template&gt;\n                &lt;\/select&gt;\n              &lt;\/td&gt;\n \n              @foreach($seed_table-&gt;columns(&#039;create&#039;) as $key =&gt; $col)\n                &lt;td class=&quot;{{ $col[&#039;class&#039;] }}&quot;&gt;\n                  &lt;input x-model=&quot;entry.{{ $key }}&quot; placeholder=&quot;{{ $col[&#039;placeholder&#039;] ?? &#039;&#039; }}&quot;\n                    @focus=&quot;$el.select()&quot;\n                  &gt;\n                &lt;\/td&gt;\n              @endforeach\n              &lt;td&gt;\n                \u2640: &lt;span x-text=&quot;entry.mother&quot;&gt;&lt;\/span&gt;\n                \u2642: &lt;span x-text=&quot;entry.father&quot;&gt;&lt;\/span&gt;\n              &lt;\/td&gt;\n            &lt;\/tr&gt;\n          &lt;\/template&gt;\n        &lt;\/tbody&gt;\n      &lt;\/table&gt;\n    &lt;\/div&gt;\n \n&lt;\/x-feature&gt;\n@endsection\n<\/pre>\n<\/div>\n<h4><code>resources\/views\/seed\/module.blade.php<\/code><\/h4>\n<p>div.features \u306b\u8ffd\u52a0\u3002\n\u540d\u524d\u304c\u7570\u306a\u308b\u3060\u3051\u3067\u3084\u308b\u3053\u3068\u306f\u540c\u3058\u306a\u306e\u3067\u3001resources\/views\/plant\/cross.blade.php \u3067\u767a\u706b\u3055\u305b\u308b\u30a4\u30d9\u30f3\u30c8\u3092post-harvest\u306b\u3059\u308b\u307b\u3046\u304c\u30b3\u30fc\u30c9\u304c\u5897\u3048\u306a\u304f\u3066\u3088\u3044\u304b\u3082\u3057\u308c\u306a\u3044\u3002<\/p>\n<div class='code'>\n<h5 class=\"source-file\">resources\/views\/seed\/module.blade.php \u306e\u4e00\u90e8<\/h5>\n<pre >\n{{-- plant\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u4ea4\u914d\u306b\u3088\u3063\u3066\u3064\u304f\u3089\u308c\u305f\u7a2e\u5b50\u306e\u30c7\u30fc\u30bf\u3092\u8868\u793a\u3059\u308b --}}\nx-on:post-cross.window=&quot;\n  console.log(&#039;post-cross event in seed\/module was called&#039;, $event.detail.items);\n  append($event.detail.items);\n&quot;\n<\/pre>\n<\/div>\n\n\n\n<div style='display: flex; justify-content: center; gap: 4rem;\n  background-color: #ffefd5;\n  '\n>\n  <a href='laravel-08'>\u524d\u3078<\/a>\n\n<a href='.\/'>PHP\u306e\u5b66\u7fd2 \u76ee\u6b21<\/a>\n\n  <a href='laravel-10'>\u6b21\u3078<\/a>\n<\/div>\n","protected":false},"excerpt":{"rendered":"\u524d\u56de\u7d42\u4e86\u6642\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9 Laravel\u3092\u4f7f\u3063\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 $ git clone https:\/\/kiku3.tsbio.info\/git\/st [&hellip;]","protected":false},"author":2,"featured_media":0,"parent":2658,"menu_order":9,"comment_status":"closed","ping_status":"closed","template":"page-programming.php","meta":{"footnotes":""},"class_list":["post-3296","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/pages\/3296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/comments?post=3296"}],"version-history":[{"count":47,"href":"https:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/pages\/3296\/revisions"}],"predecessor-version":[{"id":3447,"href":"https:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/pages\/3296\/revisions\/3447"}],"up":[{"embeddable":true,"href":"https:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/pages\/2658"}],"wp:attachment":[{"href":"https:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/media?parent=3296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}