{"id":3270,"date":"2026-08-31T11:30:22","date_gmt":"2026-08-31T02:30:22","guid":{"rendered":"https:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/?page_id=3270"},"modified":"2026-09-03T13:54:42","modified_gmt":"2026-09-03T04:54:42","slug":"laravel-08","status":"publish","type":"page","link":"https:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/programming\/php\/laravel-08","title":{"rendered":"\u7a2e\u5b50\u3068\u690d\u7269\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9"},"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 chapt8 \u30d6\u30e9\u30f3\u30c1\u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n<div class='console'><pre>\n$ git switch chapt8\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 my8 chapt8\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<\/details>\n\n\n<h2>\u5b9f\u9a13\u6750\u6599\u306e\u7a2e\u3068\u690d\u7269\u3092\u7ba1\u7406\u3059\u308b\u6a5f\u80fd\u306e\u62e1\u5f35<\/h2>\n<p>\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5171\u901a\u6a5f\u80fd\u3092\u304f\u304f\u308a\u3060\u3059\u3002<\/p>\n<h3>\u30eb\u30fc\u30c8<\/h3>\n<p><code>routes\/oligo.php<\/code> \u3092\u79fb\u690d\u3057\u3084\u3059\u3044\u3088\u3046\u306b\u4fee\u6b63\u3059\u308b\u3002\n<code>oligo<\/code>\u3068\u3044\u3046\u6587\u5b57\u3092<code>$module<\/code>\u3068\u3044\u3046\u5909\u6570\u306b\u7f6e\u304d\u63db\u3048\u308b\u3002<\/p>\n<div class='code'>\n  <h5 class=\"source-file\">routes\/oligo.php<\/h5>\n<pre >\n&lt;?php\n \nuse Illuminate\\Support\\Facades\\Route;\nuse App\\Http\\Controllers\\OligoController as Controller; \/\/ \u5225\u540d\u3092\u3064\u3051\u3066\u4ed6\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u6d41\u7528\u3057\u3084\u3059\u304f\u3059\u308b\n \n\/\/ \u30aa\u30ea\u30b4DNA\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\n$module = &#039;oligo&#039;;\nRoute::prefix(&quot;\/$module&quot;)\n    -&gt;middleware([&#039;auth&#039;, &#039;verified&#039;, &quot;can:$module.read&quot;])\n    -&gt;as(&quot;web.$module.&quot;)\n    -&gt;group(function (){\n        Route::get(&#039;\/&#039;, [Controller::class, &#039;index&#039;])-&gt;name(&#039;index&#039;);\n        Route::get(&#039;\/search&#039;, [Controller::class, &#039;search&#039;])-&gt;name(&#039;search&#039;);\n        Route::get(&#039;\/create&#039;, [Controller::class, &#039;create&#039;])-&gt;name(&#039;create&#039;);\n        Route::post(&#039;\/&#039;, [Controller::class, &#039;store&#039;])-&gt;name(&#039;store&#039;);\n \n        \/\/ \u7de8\u96c6\u30d5\u30a9\u30fc\u30e0\u3068\u30c7\u30fc\u30bf\u66f4\u65b0\n        Route::get(&#039;\/edit&#039;, [Controller::class, &#039;edit&#039;])-&gt;name(&#039;edit&#039;);\n        Route::put(&#039;\/{item}&#039;, [Controller::class, &#039;update&#039;])-&gt;name(&#039;update&#039;);\n    });\n<\/pre>\n<\/div>\n<h3>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc<\/h3>\n<p>OligoController\u3092\u6c4e\u7528\u5316\u3057\u3066MaterialController\u3068\u3059\u308b\u3002\nOligoController\u306fMaterialController\u3092\u7d99\u627f(extends)\u3057\u3066\u3001Models\/Oligo\u3068\u95a2\u9023\u3059\u308b\u30af\u30e9\u30b9\u306e\u4f9d\u5b58\u95a2\u4fc2\u3060\u3051\u3092\u8a2d\u5b9a\u3059\u308b\u3002<\/p>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">app\/Http\/Controllers\/MaterialController.php<\/h5>\n<pre >\n&lt;?php\n \nnamespace App\\Http\\Controllers;\n \nuse Illuminate\\Http\\Request;\n \nclass MaterialController\n{\n    \/* \u30ea\u30af\u30a8\u30b9\u30c8\u30af\u30e9\u30b9\u306f\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u3068\u3057\u3066\u578b\u6307\u5b9a\u3057\u3001Laravel\u304c\u81ea\u52d5\u7684\u306b\u6e21\u3059\u3088\u3046\u306b\u3057\u3066\u3044\u305f\u3002\n     * \u305d\u306e\u5834\u5408\u3001\u57fa\u5e95\u30af\u30e9\u30b9\u3067\u30e1\u30bd\u30c3\u30c9\u3092\u5171\u901a\u5316\u3059\u308b\u3068\u578b\u3092\u6307\u5b9a\u3067\u304d\u306a\u304f\u306a\u308a\u3001\u6d3e\u751f\u30af\u30e9\u30b9\u3067\u30e1\u30bd\u30c3\u30c9\u5f15\u6570\u3092\u6307\u5b9a\u3059\u308b\u3068\n     * \u57fa\u5e95\u30af\u30e9\u30b9\u306e\u30e1\u30bd\u30c3\u30c9\u3092__parent::method()\u3068\u3057\u3066\u547c\u3070\u306a\u3044\u3068\u3044\u3051\u306a\u304f\u306a\u308b\u3002\n     * \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u5b50\u30af\u30e9\u30b9\u3067\u30e1\u30bd\u30c3\u30c9\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u306a\u304f\u3001\u4f7f\u7528\u3059\u308b\u30ea\u30af\u30a8\u30b9\u30c8\u30af\u30e9\u30b9\u3092\u5909\u66f4\u3059\u308b\u305f\u3081\u306b\u3001\n     * \u3053\u3053\u3067\u30ea\u30af\u30a8\u30b9\u30c8\u30af\u30e9\u30b9\u306e\u540d\u524d\u3092\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3068\u3057\u3066\u8a2d\u5b9a\u3059\u308b\u3002\n     * \u30ea\u30af\u30a8\u30b9\u30c8\u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3067\u306f\u3001\u30af\u30e9\u30b9\u540d\u304b\u3089app(class_name)\u3067\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3059\u308b\u3002\n     * \u30ea\u30af\u30a8\u30b9\u30c8\u30af\u30e9\u30b9\u306fnew\u3067\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3059\u308b\u3068\u3084\u3084\u3053\u3057\u3044\u306e\u3067\u3001Laravel\u306e\u3057\u304f\u307f\u3092\u4f7f\u3046\u3002\n     *\/\n    protected string $singleRequest = Request::class;\n    protected string $multiRequest = Request::class;\n    protected string $queryRequest = Request::class;\n \n    \/\/ \u30e2\u30c7\u30eb($model)\u3068\u30b5\u30fc\u30d3\u30b9($service)\u306f\u5b50\u30af\u30e9\u30b9\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3067\u578b\u6307\u5b9a\u3059\u308b\n    \n    \/*\n     * \u30ea\u30af\u30a8\u30b9\u30c8\u306b\u5fdc\u3058\u3066\u30d3\u30e5\u30fc\u3092\u8fd4\u3059\u90e8\u5206\u3092\u5171\u901a\u5316\u3059\u308b\n     *\/\n    public function respond($data = [], $view = null){\n        \/\/ \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u56fa\u6709\u306e\u30eb\u30fc\u30c8\u306b\u3060\u3051\u5bfe\u5fdc\u3055\u305b\u308c\u3070\u3088\u3044\u306e\u3067\u3001\n        \/\/ app\/Providers\/AppServiceProvider.php\u3067\u3084\u3063\u3066\u3044\u305f\u51e6\u7406\u3092\u3053\u3053\u306b\u3082\u3063\u3066\u304d\u305f\n        $route_name = request()-&gt;route()-&gt;getName();\n        list($module, $feature) = array_slice(explode(&#039;.&#039;, $route_name), 1, 2);\n        view()-&gt;share([\n            &#039;module_id&#039; =&gt; $module,\n            &#039;feature_id&#039; =&gt; &quot;$module-$feature&quot;,\n            \/\/ \u30c6\u30fc\u30d6\u30eb(Model)\u306e\u30ab\u30e9\u30e0\u306e\u6271\u3044\u3092\u4e00\u5143\u5316\u3057\u305ftableDefinition\u3092\u3064\u304f\u308a\u3001\u305d\u308c\u3092\u30d3\u30e5\u30fc\u306b\u6e21\u3059\n            &#039;tableDefinition&#039; =&gt; $this-&gt;service-&gt;tableDefinition,\n        ]);\n \n        \/\/ htmx\u304b\u3089\u306e\u90e8\u5206HTML\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u5bfe\u5fdc\u3059\u308b\n        if($fragment = request()-&gt;hasHeader(&#039;HX-Request&#039;)){\n            $fragment = request()-&gt;header(&#039;HX-Target&#039;);\n        }\n        return view(&quot;$module.$feature&quot;, $data)\n            -&gt;fragmentIf($fragment, $fragment)\n        ;\n    }\n \n    \/*\n     * POST\u3001PUT\u306a\u3069JSON\u3067\u3084\u308a\u53d6\u308a\u3059\u308b\u3068\u304d\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\n     *\/\n    public function json($data = [], $code = 200)\n    {\n        if($code == 200){\n            $status = &#039;success&#039;;\n        }else {\n            $status = &#039;error&#039;;\n        }\n        return response()-&gt;json(array_merge([&#039;status&#039; =&gt; $status], $data), $code);\n    }\n \n    \/\/ GET\u30ea\u30af\u30a8\u30b9\u30c8(\u30d3\u30e5\u30fc\u3092\u8fd4\u3059)\n    public function index(){\n        return $this-&gt;respond([&#039;items&#039; =&gt; $this-&gt;model-&gt;limit(10)-&gt;get()]);\n    }\n \n    public function create(){\n        return $this-&gt;respond();\n    }\n \n    public function edit(){\n        return $this-&gt;respond();\n    }\n \n    \/\/ \u691c\u7d22\n    public function search()\n    {\n        try{\n            \/\/ app(\u30af\u30e9\u30b9\u540d)\u3068\u3059\u308b\u3053\u3068\u3067\u3001Laravel\u304c\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u3064\u304f\u308b\u3002\n            \/\/ \u4ee5\u5f8c\u306f request() \u3067queryRequest\u30af\u30e9\u30b9\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u8fd4\u3063\u3066\u304f\u308b\n            $query = app($this-&gt;queryRequest)-&gt;validated();\n            return $this-&gt;json($this-&gt;service-&gt;search($query), 200);\n        }catch(\\Throwable $e){\n            return $this-&gt;json([&#039;message&#039; =&gt; $e-&gt;getMessage()], 400);\n        }\n    }\n \n    \/\/ \u8ffd\u52a0\n    public function store()\n    {\n        try{\n            $items = app($this-&gt;multiRequest)-&gt;valids;\n            return $this-&gt;json($this-&gt;service-&gt;create($items), 200);\n        }catch(\\Throwable $e){\n            return $this-&gt;json([&#039;message&#039; =&gt; $e-&gt;getMessage()], 400);\n        }\n    }\n \n    \/\/ \u66f4\u65b0\n    public function update(int $id){\n        try{\n            $data = app($this-&gt;singleRequest)-&gt;validated();\n            $item = $this-&gt;model-&gt;findOrFail($id)-&gt;update($data);\n            return $this-&gt;json([&#039;item&#039; =&gt; $item], 200);\n        }catch(\\Throwable $e){\n            return response()-&gt;json([&#039;status&#039; =&gt; &#039;error&#039;, &#039;message&#039; =&gt; $e-&gt;getMessage()], 400);\n        }\n    }\n}\n<\/pre>\n<\/div>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">app\/Http\/Controllers\/OligoController.php<\/h5>\n<pre >\n&lt;?php\n \nnamespace App\\Http\\Controllers;\n \nuse App\\Models\\Oligo;\nuse App\\Services\\OligoService;\nuse App\\Http\\Requests\\OligoRequest;\nuse App\\Http\\Requests\\OligoSearchRequest;\nuse App\\Http\\Requests\\OligosRequest;\n \nclass OligoController extends MaterialController\n{\n    protected string $singleRequest = OligoRequest::class;\n    protected string $multiRequest = OligosRequest::class;\n    protected string $queryRequest = OligoSearchRequest::class;\n \n    public function __construct(\n        protected OligoService $service,\n        protected Oligo $model\n    ) {}\n}\n<\/pre>\n<\/div>\n<h3>\u30ea\u30af\u30a8\u30b9\u30c8<\/h3>\n<p>\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u691c\u8a3c\u30eb\u30fc\u30eb\u306fTableDefinition\u306b\u79fb\u52d5\u3057\u305f\u3002\n\u30d6\u30e9\u30a6\u30b6\u30fc\u304b\u3089JSON\u3067\u9001\u3089\u308c\u3066\u304f\u308b\u30c7\u30fc\u30bf\u306e\u578b\u3068\u691c\u8a3c\u30eb\u30fc\u30eb\u306e\u578b\u3092\u540c\u3058\u30d5\u30a1\u30a4\u30eb\u306b\u304a\u3044\u3066\u3001\u60c5\u5831\u3092\u4e00\u5143\u5316\u3059\u308b\u3002<\/p>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">app\/Http\/Requests\/OligoSearchRequest.php<\/h5>\n<pre >\n&lt;?php\n \nnamespace App\\Http\\Requests;\n \nuse Illuminate\\Foundation\\Http\\FormRequest;\nuse App\\TableDefinitions\\OligoTableDefinition;\n \nclass OligoSearchRequest extends FormRequest\n{\n    public function rules(OligoTableDefinition $table): array\n    {\n        return $table-&gt;searchRules();\n    }\n}\n<\/pre>\n<\/div>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">app\/Http\/Requests\/OligoRequest.php<\/h5>\n<pre >\n&lt;?php\n \nnamespace App\\Http\\Requests;\n \nuse Illuminate\\Contracts\\Validation\\ValidationRule;\nuse Illuminate\\Foundation\\Http\\FormRequest;\nuse App\\TableDefinitions\\OligoTableDefinition;\n \nclass OligoRequest extends FormRequest\n{\n    public function rules(OligoTableDefinition $table): array\n    {\n        return $table-&gt;insertRules();\n    }\n}\n<\/pre>\n<\/div>\n<p>\u8907\u6570\u306e\u30c7\u30fc\u30bf\u7528\u306eOligosRequest\u304c\u3082\u3064\u914d\u5217\u691c\u8a3c\u306e\u65b9\u6cd5\u3092 <code>MultiItemsRequest<\/code> \u306b\u79fb\u52d5\u3059\u308b\u3002\nOligosRequest\u306fMultiItemsRequest\u3092\u7d99\u627f\u3057\u3066\u3001\u5358\u4f53\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u30af\u30e9\u30b9\u540d\u3060\u3051\u3092\u3082\u3064\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">app\/Http\/Requests\/MultiItemsRequest.php<\/h5>\n<pre >\n&lt;?php\n \nnamespace App\\Http\\Requests;\n \nuse Illuminate\\Contracts\\Validation\\Validator;\nuse Illuminate\\Foundation\\Http\\FormRequest;\n \nclass MultiItemsRequest extends FormRequest\n{\n    protected string $singleRequest = FormRequest::class;\n \n    public array $valids = [];\n    public array $invalids = [];\n \n    public function rules(): array\n    {\n        return [\n            &#039;items&#039; =&gt; [&#039;required&#039;, &#039;array&#039;],\n            &#039;items.*&#039; =&gt; [&#039;array&#039;],\n        ];\n    }\n \n    public function messages(): array\n    {\n        return [\n            &#039;items.required&#039; =&gt; &#039;\u5165\u529b\u5024\u304c\u3042\u308a\u307e\u305b\u3093\u3002&#039;,\n            &#039;items.array&#039; =&gt; &#039;\u9001\u4fe1\u3055\u308c\u305f\u30c7\u30fc\u30bf\u306f\u914d\u5217\u3067\u3042\u308a\u307e\u305b\u3093\u3002&#039;,\n        ];\n    }\n \n    protected function passedValidation()\n    {\n        $single = new $this-&gt;singleRequest();\n        $rules = app()-&gt;call([$single, &#039;rules&#039;]);\n        $messages = app()-&gt;call([$single, &#039;messages&#039;]);\/\/$single-&gt;messages();\n \n        $items = $this-&gt;input(&#039;items&#039;, []);\n \n        foreach ($items as $index =&gt; $item) {\n            $validator = \\Validator::make($item, $rules, $messages);\n \n            if ($validator-&gt;fails()) {\n                $this-&gt;invalids[$index] = [\n                    &#039;data&#039; =&gt; $item,\n                    &#039;errors&#039; =&gt; $validator-&gt;errors()-&gt;toArray(),\n                ];\n            } else {\n                $this-&gt;valids[] = $validator-&gt;validated();\n            }\n        }\n    }\n}\n<\/pre>\n<\/div>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">app\/Http\/Requests\/OligosRequest.php<\/h5>\n<pre >\n&lt;?php\n \nnamespace App\\Http\\Requests;\n \nclass OligosRequest extends MultiItemsRequest\n{\n    protected string $singleRequest = OligoRequest::class;\n}\n<\/pre>\n<\/div>\n<h3>\u30b5\u30fc\u30d3\u30b9<\/h3>\n<p>OligoService\u3092\u6c4e\u7528\u5316\u3057\u3066MaterialService\u3068\u3059\u308b\u3002\n\u305d\u306e\u305f\u3081\u306b\u306f\u30c6\u30fc\u30d6\u30eb\u306e\u3069\u306e\u5217\u3092\u3069\u3046\u3044\u3046\u65b9\u6cd5\u3067\u691c\u7d22\u3059\u308b\u306e\u304b\u3068\u3044\u3046\u60c5\u5831\u3092\u3001TableDefinition\u30af\u30e9\u30b9\u306b\u6301\u3063\u3066\u3044\u3063\u3066\u3001\u305d\u3053\u304b\u3089\u691c\u7d22\u65b9\u6cd5\u3067\u53d6\u5f97\u3059\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<p>OligoService\u306fMaterialservice\u3092\u7d99\u627f\u3057\u3066\u3001\u4f9d\u5b58\u95a2\u4fc2\u3060\u3051\u3092\u5b9a\u7fa9\u3059\u308b\u3002<\/p>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">app\/Services\/MaterialService.php<\/h5>\n<pre >\n&lt;?php\n \nnamespace App\\Services;\n \nclass MaterialService \n{\n    \/* \u4ee5\u4e0b\u306e\u3082\u306e\u306f\u6d3e\u751f\u30af\u30e9\u30b9\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3067\u578b\u6307\u5b9a\u3057\u3001\u6ce8\u5165(DI)\u3059\u308b\n     * $model: \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c6\u30fc\u30d6\u30eb\n     * $tableDefinition: \u30c6\u30fc\u30d6\u30eb\u306e\u30ab\u30e9\u30e0\u306e\u6271\u3044\u3092\u4e00\u5143\u5316\u3057\u305f\u5b9a\u7fa9\n     * $searchFactory: \u691c\u7d22\u306e\u7a2e\u985e\u3092\u5207\u308a\u66ff\u3048\u308b\u305f\u3081\u306e\u30d5\u30a1\u30af\u30c8\u30ea\u30fc\n     *\/\n \n    \/* \u691c\u7d22\n     * $query\u306f\u30ea\u30af\u30a8\u30b9\u30c8\u30af\u30e9\u30b9\u306e\u691c\u8a3c\u6e08\u307f\u30c7\u30fc\u30bf\u3002\u5217\u540d =&gt; \u691c\u7d22\u5024\u306e\u9023\u60f3\u914d\u5217\n     *\/\n \n    public function search(array $query)\n    {\n        $builder = $this-&gt;model-&gt;newQuery();\n \n        foreach ($query as $column =&gt; $value) {\n \n            if (is_string($value) &amp;&amp; trim($value) === &#039;&#039;){\n                continue;\n            }\n            \n            \/\/ \u30c6\u30fc\u30d6\u30eb\u306e\u5b9a\u7fa9\u304b\u3089\u3001\u5217\u306e\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\n            $definition = $this-&gt;tableDefinition-&gt;column($column);\n            if (!$definition) {\n                continue;\n            }\n \n            \/\/ \u691c\u7d22\u306e\u7a2e\u985e\u3092\u53d6\u5f97\u3059\u308b\n            $type = $definition[&#039;search&#039;][&#039;type&#039;] ?? null;\n            if (!$type) {\n                continue;\n            }\n \n            \/\/ \u691c\u7d22\u306e\u7a2e\u985e\u306b\u5fdc\u3058\u3066\u3001\u691c\u7d22\u3092\u9069\u7528\u3059\u308b\n            $this-&gt;searchFactory-&gt;make($type)-&gt;apply($builder, $column, $value);\n        }\n \n        return [\n            &#039;items&#039; =&gt; $builder-&gt;get(),\n            &#039;sql&#039; =&gt; $builder-&gt;toSql(),\n            &#039;query&#039; =&gt; $query\n        ];\n    }\n \n    public function create(array $items)\n    {\n        $results = [\n            &#039;created&#039; =&gt; [], \n            &#039;succeeded&#039; =&gt; [],\n            &#039;failed&#039; =&gt; [], \n        ];\n \n        foreach($items as $index =&gt; $item){\n            try{\n                $created = $this-&gt;model-&gt;create($item);\n                $results[&#039;created&#039;][] = $created;\n                $results[&#039;succeeded&#039;][$index] = $created;\n            }catch(\\Throwable $e){\n                $results[&#039;failed&#039;][$index] = array_merge($item, [&#039;error&#039; =&gt; $e-&gt;getMessage()]);\n            }\n        }\n        return $results;\n    }\n}\n<\/pre>\n<\/div>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">app\/Services\/OligoService.php<\/h5>\n<pre >\n&lt;?php\n \nnamespace App\\Services;\n \nuse App\\Models\\Oligo;\nuse App\\TableDefinitions\\OligoTableDefinition;\nuse App\\TableSearch\\SearchFactory;\n \nclass OligoService extends MaterialService\n{\n    public function __construct(\n        protected Oligo $model,\n        public OligoTableDefinition $tableDefinition,\n        protected SearchFactory $searchFactory\n    ){}\n}\n<\/pre>\n<\/div>\n<h3>\u691c\u7d22<\/h3>\n<p>\u30c6\u30fc\u30d6\u30eb\u306e\u691c\u7d22\u306e\u5b9f\u88c5\u3002\nEloquent\u306e\u30af\u30a8\u30ea\u30fc\u30d3\u30eb\u30c0\u30fc\u3092\u4f7f\u3063\u3066\u3001\u6761\u4ef6(where)\u3092\u8ffd\u52a0\u3057\u3066\u3044\u304f\u3002<\/p>\n<p>SearchFactory\u3067SearchType\u3092\u7d99\u627f\u3057\u305f\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u3064\u304f\u308a\u3001\u305d\u3053\u3067SQL\u3092\u7d44\u307f\u7acb\u3066\u308b\u3002\n\u3068\u308a\u3042\u3048\u305a\u3001like\u3001\u6b63\u898f\u8868\u73fe\u3001like\u307e\u305f\u306f\u6b63\u898f\u8868\u73fe\u30016\u6841\u65e5\u4ed8\u306e\u7bc4\u56f2\u691c\u7d22\u3001\u3092\u53ef\u80fd\u306b\u3059\u308b\u3002<\/p>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">app\/TableSearch\/SearchFactory.php<\/h5>\n<pre >\n&lt;?php\n \nnamespace App\\TableSearch;\n \nuse Illuminate\\Database\\Eloquent\\Builder;\nuse InvalidArgumentException;\n \nclass SearchFactory\n{\n    protected array $searchTypes = [\n        &#039;like&#039; =&gt; LikeSearch::class,\n        &#039;equal&#039; =&gt; EqualSearch::class,\n        &#039;regex&#039; =&gt; RegexSearch::class,\n        &#039;likeOrRegex&#039; =&gt; LikeOrRegexSearch::class,\n        &#039;date6&#039; =&gt; Date6Search::class,\n    ];\n \n    public function make(string $type)\n    {\n        $class = $this-&gt;searchTypes[$type]\n            ?? throw new InvalidArgumentException(\n                &quot;Unknown search type: {$type}&quot;\n            );\n \n        return app($class);\n    }\n}\n<\/pre>\n<\/div>\n<\/p>\n<div class='code'>\n  <h5 class=\"source-file\">app\/TableSearch\/SearchType.php<\/h5>\n<pre >\n&lt;?php\n \nnamespace App\\TableSearch;\n \nuse Illuminate\\Database\\Eloquent\\Builder;\n \ninterface SearchType\n{\n    public function apply(Builder $builder, string $column, mixed $value): Builder;\n}\n<\/pre>\n<\/div>\n<\/p>\n<div class='code'>\n  <h5 class=\"source-file\">app\/TableSearch\/LikeSearch.php<\/h5>\n<pre >\n&lt;?php\n \nnamespace App\\TableSearch;\n \nuse Illuminate\\Database\\Eloquent\\Builder;\n \nclass LikeSearch implements SearchType\n{\n    public function apply(Builder $builder, string $column, mixed $value): Builder \n    {\n        if (!is_string($value) || trim($value) === &#039;&#039;) {\n            return $builder;\n        }\n \n        $pattern = &#039;\/&quot;([^&quot;]*)&quot;|\\&#039;([^\\&#039;]*)\\&#039;|([^\\s]+)\/u&#039;;\n \n        if (preg_match_all($pattern, $value, $matches, PREG_SET_ORDER)) {\n            foreach($matches as $m){\n                $token = current(array_filter(\n                    array_slice($m, 1),\n                    fn($v) =&gt; $v !== &#039;&#039;\n                ));\n                if($token !== false){\n                    $builder-&gt;where($column, &#039;like&#039;, &quot;%{$token}%&quot;);\n                }\n            }\n        }\n \n        return $builder;\n    }\n}\n<\/pre>\n<\/div>\n<\/p>\n<div class='code'>\n  <h5 class=\"source-file\">app\/TableSearch\/RegexSearch.php<\/h5>\n<pre >\n&lt;?php\n \nnamespace App\\TableSearch;\n \nuse Illuminate\\Database\\Eloquent\\Builder;\n \nclass RegexSearch implements SearchType\n{\n    public function apply(Builder $builder, string $column, mixed $value): Builder \n    {\n        if (!is_string($value) || trim($value) === &#039;&#039;) {\n            return $builder;\n        }\n        return $builder-&gt;where($column, &#039;~&#039;, $value);\n    }\n}\n<\/pre>\n<\/div>\n<\/p>\n<div class='code'>\n  <h5 class=\"source-file\">app\/TableSearch\/LikeOrRegexSearch.php<\/h5>\n<pre >\n&lt;?php\n \nnamespace App\\TableSearch;\n \nuse Illuminate\\Database\\Eloquent\\Builder;\n \nclass LikeOrRegexSearch implements SearchType\n{\n    public function __construct(protected SearchFactory $searchFactory)\n    {}\n \n    public function apply(Builder $builder, string $column, mixed $value): Builder \n    {\n        if (!is_array($value) || !isset($value[&#039;value&#039;])) {\n            return $builder;\n        }\n \n        if(isset($value[&#039;mode&#039;]) &amp;&amp; $value[&#039;mode&#039;] == &#039;regex&#039;){\n            $search = $this-&gt;searchFactory-&gt;make(&#039;regex&#039;);\n        }else{\n            $search = $this-&gt;searchFactory-&gt;make(&#039;like&#039;);\n        }\n \n        return $search-&gt;apply($builder, $column, $value[&#039;value&#039;]);\n    }\n}\n<\/pre>\n<\/div>\n<\/p>\n<div class='code'>\n  <h5 class=\"source-file\">app\/TableSearch\/Date6Search.php<\/h5>\n<pre >\n&lt;?php\n \nnamespace App\\TableSearch;\n \nuse Illuminate\\Database\\Eloquent\\Builder;\nuse App\\Traits\\ConvertsYmdDate;\n \nclass Date6Search implements SearchType\n{\n    use ConvertsYmdDate;\n \n    public function apply(Builder $builder, string $column, mixed $value): Builder\n    {\n        if (!is_string($value) || trim($value) === &#039;&#039;) {\n            return $builder;\n        }\n \n        \/\/ \u4f8b: &quot;210101-221231&quot;, &quot;210101-&quot;, &quot;-221231&quot;, &quot;210101&quot;\n        $parts = explode(&#039;-&#039;, $value);\n \n        \/\/ 210304\n        if (count($parts) === 1) {\n            return $builder-&gt;where($column, &#039;=&#039;, $this-&gt;ymdToDate($parts[0]));\n        }\n \n        [$start, $end] = $parts;\n \n        \/\/ 210304-\n        if ($start !== &#039;&#039;) {\n            $builder-&gt;where($column, &#039;&gt;=&#039;, $this-&gt;ymdToDate($start));\n        }\n \n        \/\/  -250607\n        if ($end !== &#039;&#039;) {\n            $builder-&gt;where($column, &#039;&lt;=&#039;, $this-&gt;ymdToDate($end));\n        }\n \n        return $builder;\n    }\n}\n<\/pre>\n<\/div>\n<h3>\u30c6\u30fc\u30d6\u30eb\u5b9a\u7fa9<\/h3>\n<p>\u30c6\u30fc\u30d6\u30eb\u306e\u5217\u306e\u53d6\u308a\u6271\u3044\u304b\u305f(\u691c\u7d22\u65b9\u6cd5\u3001HTML\u3067\u306e\u8868\u793a\u65b9\u6cd5)\u3092\u3082\u3064\u30af\u30e9\u30b9\u3092\u5b9a\u7fa9\u3059\u308b\u3002<\/p>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">app\/TableDefinitions\/AbstractTableDefinition.php<\/h5>\n<pre >\n&lt;?php\n \nnamespace App\\TableDefinitions;\n \nuse Illuminate\\Validation\\Rule;\n \nabstract class AbstractTableDefinition\n{\n    protected array $columns = [];\n \n    \/\/ index\u3068create\u3068edit\u3067\u8868\u793a\u3059\u308b\u5217\u3092\u5909\u3048\u308b\n    public function columns(?string $feature = null): array\n    {\n        if ($feature === null) {\n            return $this-&gt;columns;\n        }\n \n        return array_filter(\n            $this-&gt;columns,\n            fn (array $column) =&gt;\n                in_array($feature, $column[&#039;features&#039;] ?? [], true)\n        );\n    }\n \n    \/\/ \u5217\u306e\u60c5\u5831\u3092\u53d6\u308a\u51fa\u3059\u3002\n    public function column(string $name): ?array\n    {\n        return $this-&gt;columns[$name] ?? null;\n    }\n \n    \/\/ \u4e00\u6bb5\u968e\u968e\u5c64\u3092\u6e1b\u3089\u3057\u3066\u3001\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u697d\u306b\u3059\u308b\n    public function mergeSection(string $section): array\n    {\n        $results = [];\n        foreach($this-&gt;columns as $column_name =&gt; $col){\n            if(! isset($col[$section])) continue;\n            $results[$column_name] = array_merge($col, $col[$section]);\n        }\n        return $results;\n    }\n \n    public function searchColumns(): array\n    {\n        return $this-&gt;mergeSection(&#039;search&#039;);\n    }\n \n    public function formColumns(): array\n    {\n        return $this-&gt;mergeSection(&#039;form&#039;);\n    }\n \n    \/*\n     * \u691c\u7d22\u65b9\u6cd5\u3068\u691c\u8a3c\u3068JSON\u306e\u5f62\u5f0f\u3092\u4e00\u81f4\u3055\u305b\u308b\u305f\u3081\u306e\u51e6\u7406\n     * LikeOrRegex\u306b $column, $value = [&#039;value&#039; =&gt; &#039;query_string&#039;, &#039;mode&#039; =&gt; &#039;like|regex&#039;] \u3092\u6e21\u3059\u3088\u3046\u306b\u3059\u308b\n     * SearchRequest-&gt;rule()\u306b\u306f column.value =&gt; &#039;rules&#039;, column.mode =&gt; &#039;like|regex&#039; \u304c\u5fc5\u8981\u3002\n     * x-data = {query: {name: {value:&#039;&#039;, mode:&#039;regex&#039;}, ...}}\n     * HTML\u3067 &lt;input type=&#039;text&#039; x-model = &#039;column.value&#039;&gt;\u3068 &lt;input type=&#039;checkbox&#039; x-model = &#039;column.mode&#039; value=&#039;regex&#039;&gt;\n     *\/\n \n    \/\/ OligoSearchRequest\u306a\u3069\u3067\u547c\u3076\u3002\n    public function searchRules(): array\n    {\n        $rules = [];\n \n        foreach ($this-&gt;searchColumns() as $name =&gt; $column) {\n            switch($column[&#039;type&#039;]) {\n                case &#039;likeOrRegex&#039;:\n                    $rules[&quot;{$name}.value&quot;] = $column[&#039;rule&#039;] ?? [&#039;nullable&#039;, &#039;string&#039;, &#039;max:100&#039;];\n                    if (isset($column[&#039;modes&#039;])) {\n                        $rules[&quot;{$name}.mode&quot;] = [\n                            &#039;nullable&#039;,\n                            Rule::in($column[&#039;modes&#039;]),\n                        ];\n                    }\n                    break;\n                case &#039;date6&#039;:\n                    $rules[$name] = $column[&#039;rule&#039;] ?? [&#039;nullable&#039;, &#039;regex:\/^[0-9]*-?[0-9]*$\/&#039;];\n                    break;\n                case &#039;like&#039;:\n                case &#039;equal&#039;:\n                case &#039;regex&#039;:\n                case &#039;date&#039;:\n                case &#039;date_range&#039;:\n                    $rules[$name] = $column[&#039;rule&#039;] ?? [&#039;nullable&#039;, &#039;string&#039;, &#039;max:100&#039;];\n                    break;\n                default:\n                    throw new \\InvalidArgumentException(&quot;Unknown search type: {$column[&#039;type&#039;]}&quot;);\n            }\n \n        }\n \n        return $rules;\n    }\n    \n    \/\/ SingleRequest\u3067\u547c\u3076\u3002\n    public function insertRules(): array\n    {\n        $rules = [];\n        foreach ($this-&gt;columns() as $name =&gt; $column) {\n            $rules[$name] = $column[&#039;insert&#039;][&#039;rule&#039;] ?? [&#039;nullable&#039;];\n        }\n        return $rules;\n    }\n \n    public function buildQueryDefaults(): array\n    {\n        $keys = [];\n \n        foreach ($this-&gt;searchColumns() as $name =&gt; $column) {\n            switch($column[&#039;type&#039;]) {\n                case &#039;likeOrRegex&#039;:\n                    $keys[$name] = [&quot;value&quot; =&gt; &#039;&#039;, &quot;mode&quot; =&gt; &#039;&#039;];\n                    break;\n                default:\n                    $keys[$name] = &#039;&#039;;\n                    break;\n            }\n        }\n        return $keys;\n    }\n \n    \/\/ HTML\u30d5\u30a9\u30fc\u30e0\u3067\u7a7a\u6b04\u30c1\u30a7\u30c3\u30af\u306b\u4f7f\u3046\u914d\u5217\n    public function requiredColumns(): array\n    {\n        $requiredColumns = [];\n        foreach($this-&gt;insertRules() as $name =&gt; $rules){\n            if(is_string($rules)) $rules = explode(&quot;|&quot;, $rules);\n            if(! is_array($rules)) continue;\n            if(in_array(&#039;required&#039;, $rules)) $requiredColumns[] = $name;\n        }\n        return $requiredColumns;\n    }\n}\n<\/pre>\n<\/div>\n<p>Model\/Oligo \u306e\u30ab\u30e9\u30e0\u306b\u95a2\u3059\u308b\u60c5\u5831\u3092\u96c6\u7d04\u3059\u308b\u3002<\/p>\n<p>\u3044\u3056\u3084\u3063\u3066\u307f\u308b\u3068\u3042\u307e\u308a\u898b\u3084\u3059\u304f\u306a\u3044\u306e\u3067\u3001\u4eca\u5f8c\u914d\u5217\u306e\u69cb\u9020\u306b\u3064\u3044\u3066\u306f\u8981\u691c\u8a0e\u3002<\/p>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">app\/TableDefinitions\/OligoTableDefinition.php<\/h5>\n<pre >\n&lt;?php\n \nnamespace App\\TableDefinitions;\n \nclass OligoTableDefinition extends AbstractTableDefinition\n{\n    protected array $columns = [\n        &#039;name&#039; =&gt; [\n            \/\/ HTML\u306etable\u306b\u304a\u3044\u3066\u3053\u306e\u5217\u3092\u8868\u793a\u3059\u308b\u30d5\u30a3\u30fc\u30c1\u30e3\u30fc\n            &#039;features&#039; =&gt; [&#039;index&#039;, &#039;create&#039;, &#039;edit&#039;, &#039;delete&#039;],\n            \/\/ \u5217\u540d th\n            &#039;label&#039; =&gt; &#039;\u540d\u524d&#039;,\n            \/\/ \u30af\u30e9\u30b9 th\u307e\u305f\u306ftd\u3067\u4f7f\u7528\n            &#039;class&#039; =&gt; &#039;name&#039;,\n            \/\/ input\u306eplacehoder\u5c5e\u6027\n            &#039;form&#039; =&gt; [\n                &#039;placeholder&#039; =&gt; &#039;DROL1&#039;,\n            ],\n            \/\/ \u691c\u7d22\u65b9\u6cd5\n            &#039;search&#039; =&gt; [\n                &#039;type&#039; =&gt; &#039;likeOrRegex&#039;,\n                &#039;modes&#039; =&gt; [&#039;like&#039;, &#039;regex&#039;],\n                &#039;rule&#039; =&gt; &#039;nullable|string|max:255&#039;, \/\/ OligoSearchReqest\u3067\u4f7f\u7528\n            ],\n            &#039;insert&#039; =&gt; [\n                \/\/ OligoReqest\u3067\u4f7f\u7528\u3002HTML\u306etable\u3067\u7a7a\u884c\u5224\u5b9a\u306b\u3082\u4f7f\u7528\n                &#039;rule&#039; =&gt; [&#039;required&#039;, &#039;string&#039;, &#039;max:100&#039;],\n            ]\n        ],\n        &#039;sequence&#039; =&gt; [\n            &#039;features&#039; =&gt; [&#039;index&#039;, &#039;create&#039;, &#039;edit&#039;, &#039;delete&#039;],\n            &#039;label&#039; =&gt; &#039;\u914d\u5217&#039;,\n            &#039;class&#039; =&gt; &#039;sequence&#039;,\n            &#039;form&#039; =&gt; [\n                &#039;placeholder&#039; =&gt; &quot;ATCG...&quot;,\n            ],\n            &#039;search&#039; =&gt; [\n                &#039;type&#039; =&gt; &#039;like&#039;,\n                &#039;rule&#039; =&gt; &#039;nullable|string|max:255&#039;,\n            ],\n            &#039;insert&#039; =&gt; [\n                &#039;rule&#039; =&gt; [&#039;required&#039;, &#039;string&#039;, &#039;regex:\/^[A-Z]{6,255}$\/&#039;],\n            ]\n        ],\n        &#039;created_at&#039; =&gt; [\n            &#039;features&#039; =&gt; [&#039;index&#039;, &#039;create&#039;, &#039;edit&#039;, &#039;delete&#039;],\n            &#039;label&#039; =&gt; &#039;\u4f5c\u6210\u65e5&#039;,\n            &#039;class&#039; =&gt; &#039;date6&#039;,\n            &#039;form&#039; =&gt; [\n                &#039;placeholder&#039; =&gt; &quot;260101&quot;,\n                &#039;title&#039;=&gt;&quot;6\u6841\u306e\u6570\u5b57\u3067\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002-\u3067\u7bc4\u56f2\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002&quot;,\n            ],\n            &#039;search&#039; =&gt; [\n                &#039;type&#039; =&gt; &#039;date6&#039;,\n            ],            \n            &#039;insert&#039; =&gt; [\n                &#039;rule&#039; =&gt; [&#039;nullable&#039;, &#039;string&#039;, &#039;regex:\/^[0-9]{6}$\/&#039;],\n            ],\n        ],\n        &#039;updated_at&#039; =&gt; [\n            &#039;features&#039; =&gt; [&#039;edit&#039;],\n            &#039;label&#039; =&gt; &#039;\u66f4\u65b0\u65e5&#039;,\n            &#039;class&#039; =&gt; &#039;date6&#039;,\n            &#039;form&#039; =&gt; [\n                &#039;placeholder&#039; =&gt; &quot;260101&quot;,\n                &#039;title&#039;=&gt;&quot;6\u6841\u306e\u6570\u5b57\u3067\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002-\u3067\u7bc4\u56f2\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002&quot;,\n            ],\n            &#039;search&#039; =&gt; [\n                &#039;type&#039; =&gt; &#039;date6&#039;,\n            ],\n        ],\n        &#039;owner&#039; =&gt; [\n            &#039;features&#039; =&gt; [&#039;index&#039;, &#039;create&#039;, &#039;edit&#039;, &#039;delete&#039;],\n            &#039;label&#039; =&gt; &#039;\u4f5c\u6210\u8005&#039;,\n            &#039;class&#039; =&gt; &#039;owner&#039;,\n            &#039;form&#039; =&gt; [\n                &#039;placeholder&#039; =&gt; &quot;\u4f5c\u6210\u8005&quot;,\n            ],\n            &#039;search&#039; =&gt; [\n                &#039;type&#039; =&gt; &#039;like&#039;,\n                &#039;rule&#039; =&gt; &#039;nullable|string|max:255&#039;,\n            ],\n            &#039;insert&#039; =&gt; [\n                &#039;rule&#039; =&gt; [&#039;nullable&#039;, &#039;string&#039;, &#039;max:100&#039;],\n            ]\n        ],\n        \/* \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c6\u30fc\u30d6\u30eb\u3067\u306f\u3064\u304f\u3063\u3066\u3042\u308b\u3002\n            &#039;box&#039; =&gt; &#039;nullable|string|max:255&#039;,\n            &#039;note&#039; =&gt; &#039;nullable|string|max:255&#039;,\n        *\/\n    ];\n}\n<\/pre>\n<\/div>\n<h3>\u30d3\u30e5\u30fc\u306e\u4fee\u6b63<\/h3>\n<p>oligo\u4ee5\u4e0b\u306e\u30d3\u30e5\u30fc\u3092material\u4ee5\u4e0b\u306b\u30b3\u30d4\u30fc\u3057\u3066\u3001\u30aa\u30ea\u30b4\u306b\u95a2\u3059\u308b\u60c5\u5831\u3092\u524a\u9664\u3059\u308b\u3002<\/p>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">resources\/views\/components\/material\/index.blade.php<\/h5>\n<pre >\n@props([&#039;id&#039;, &#039;items&#039; =&gt; [],])\n&lt;x-feature :id=&#039;$id&#039;&gt;\n  &lt;table\n    class=&#039;material-list border-t-2 border-b-2 border-x&#039; {{-- \u8272\u306f\u30e2\u30b8\u30e5\u30fc\u30eb\u3054\u3068\u306b\u6307\u5b9a\u3059\u308b --}}\n    x-init=&quot;\n      {{-- index\u7d4c\u7531\u306e\u3068\u304d\u306b\u521d\u671f\u5024\u3068\u3057\u3066\u6e21\u3055\u308c\u308b$items\u3092items\u306b\u8a2d\u5b9a\u3059\u308b --}}\n      if(items.length === 0) {\n        items = @js($items);\n      }\n    &quot;\n  &gt;\n    &lt;thead&gt;\n      {{-- thead 1\u884c\u76ee \u898b\u51fa\u3057 --}}\n      &lt;tr class=&#039;query&#039;&gt;\n        &lt;th&gt;&lt;\/th&gt;\n        {{ $header_prepend ?? &#039;&#039; }}  {{-- \u30e2\u30b8\u30e5\u30fc\u30eb\u3054\u3068\u306b\u7570\u306a\u308b\u5217\u6570\u3078\u306e\u5bfe\u5fdc --}}\n        {{-- \u5217\u6570\u3092\u30e2\u30b8\u30e5\u30fc\u30eb\u3084\u30d5\u30a3\u30fc\u30c1\u30e3\u30fc\u304b\u3089\u72ec\u7acb\u3055\u305b\u308b --}}\n        @foreach($tableDefinition-&gt;columns(&#039;index&#039;) as $col)\n          &lt;x-material.table-th :column=$col \/&gt;\n        @endforeach\n        {{ $header_append ?? &#039;&#039; }}\n      &lt;\/tr&gt;\n \n      {{-- thead 2\u884c\u76ee \u30d5\u30a9\u30fc\u30e0 --}}\n      &lt;tr @input.debounce.500=&quot;search()&quot; class=&quot;query border-b-2 align-text-top&quot;&gt;\n        &lt;th&gt;\u691c\u7d22&lt;\/th&gt;\n \n        {{-- \u8868\u306e\u30bb\u30eb(td)\u3082\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b\u3057\u3066\u3082\u3088\u3044\u304b\u3082\u3057\u308c\u306a\u3044\u304c\u3001\u5171\u901a\u6027\u304c\u9ad8\u304f\u306a\u3044\u306e\u3067\u4eca\u5f8c\u306e\u8ab2\u984c\u3068\u3059\u308b --}}\n        @foreach($tableDefinition-&gt;columns(&#039;index&#039;) as $key =&gt; $col)\n          &lt;td class=&quot;{{ $col[&#039;class&#039;] }}&quot;&gt;\n            @if($col[&#039;search&#039;][&#039;type&#039;] == &#039;likeOrRegex&#039;)\n              &lt;input x-model=&quot;query.{{ $key }}.value&quot;\n                placeholder=&quot;{{ $col[&#039;form&#039;][&#039;placeholder&#039;] ?? &#039;&#039; }}&quot;\n              &gt;\n              &lt;label&gt;\n                &lt;input type=&quot;checkbox&quot; x-model=&quot;query.{{ $key }}.mode&quot; value=1 title=&quot;\u6b63\u898f\u8868\u73fe&quot;&gt;\n                \u6b63\u898f\u8868\u73fe\n              &lt;\/label&gt;\n            @endif\n            @if($col[&#039;search&#039;][&#039;type&#039;] != &#039;likeOrRegex&#039;)\n              &lt;input x-model=&quot;query.{{ $key }}&quot;\n                placeholder=&quot;{{ $col[&#039;form&#039;][&#039;placeholder&#039;] ?? &#039;&#039; }}&quot;\n              &gt;\n            @endif\n          &lt;\/td&gt;\n        @endforeach\n \n        &lt;td&gt;&lt;\/td&gt;\n      &lt;\/tr&gt;\n \n      {{-- thead 3\u884c\u76ee \u30dc\u30bf\u30f3 --}}\n      &lt;tr&gt;\n        &lt;td colspan=&quot;9&quot; class=&#039;px-2 py-2&#039;&gt;\n          &lt;button @click=&quot;search()&quot;&gt;  {{-- @input\u3067\u81ea\u52d5\u5b9f\u884c\u3055\u308c\u308b\u304c\u3001\u30dc\u30bf\u30f3\u3082\u52a0\u3048\u3066\u304a\u304f --}}\n            \u691c\u7d22\n            &lt;x-ajax-state var=&#039;query&#039; \/&gt;\n          &lt;\/button&gt;\n \n          {{-- \u30c1\u30a7\u30c3\u30af\u30dc\u30bf\u30f3\u3067\u9078\u629e\u30fb\u975e\u9078\u629e\u3092\u3059\u308b --}}\n          &lt;button @click.prevent=&quot;\n            items.forEach(item =&gt; item.checked = !item.checked);\n            console.log(&#039;check reverse&#039;, items.length, getCheckedItems().length, hasChecked());\n          &quot;&gt;\n            \u30c1\u30a7\u30c3\u30af\u3092\u53cd\u8ee2\n          &lt;\/button&gt;\n \n          &lt;button @click=&quot;resetQuery();&quot;&gt;\u6761\u4ef6\u30af\u30ea\u30a2&lt;\/button&gt;\n        &lt;\/td&gt;\n      &lt;\/tr&gt;\n \n      {{-- thead 4\u884c\u76ee \u691c\u7d22\u7d50\u679c --}}\n      &lt;tr class=&#039;border-b-2&#039;&gt;\n        &lt;td x-show=&quot;items.length == 0&quot; colspan=&quot;9&quot;&gt;\n          \u6761\u4ef6\u306b\u5408\u3046\u3082\u306e\u306f\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002\n        &lt;\/td&gt;\n        &lt;td x-show=&quot;items.length &gt; 0&quot; colspan=&quot;9&quot;&gt;\n          \u691c\u7d22\u7d50\u679c: &lt;span x-text=&quot;items.length&quot;&gt;&lt;\/span&gt;\u4ef6\n          (\u2611: &lt;span x-text=&quot;getCheckedItems().length&quot;&gt;&lt;\/span&gt;\u4ef6)\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;\/td&gt;\n      &lt;\/tr&gt;\n    &lt;\/thead&gt;\n \n    &lt;tbody&gt;\n      {{-- \u691c\u7d22\u7d50\u679c --}}\n      {{-- Alpine.js (x-for)\u306b\u3088\u3063\u3066\u3001items\u914d\u5217\u306e\u305d\u308c\u305e\u308c\u306e\u8981\u7d20\u3092item\u306b\u53d6\u308a\u51fa\u3057\u3001template\u8981\u7d20\u3092\u5897\u3084\u3059 --}}\n      &lt;template x-for=&quot;item in items&quot; :key=&quot;item.id&quot;&gt;\n        &lt;tr&gt;\n          &lt;td&gt;&lt;input x-model=&quot;item.checked&quot; type=&#039;checkbox&#039;&gt;&lt;\/td&gt;\n          {{ $body_prepend ?? &#039;&#039; }}\n          @foreach($tableDefinition-&gt;columns(&#039;index&#039;) as $key =&gt; $col)\n            &lt;td x-text=&quot;item.{{ $key }}&quot; class=&quot;{{ $col[&#039;class&#039;] }}&quot;&gt;&lt;\/td&gt;\n          @endforeach\n          {{ $body_append ?? &#039;&#039; }}\n        &lt;\/tr&gt;\n      &lt;\/template&gt;\n    &lt;\/tbody&gt;\n  &lt;\/table&gt;\n&lt;\/x-feature&gt;\n<\/pre>\n<\/div>\n<\/p>\n<div class='code'>\n  <h5 class=\"source-file\">resources\/views\/components\/material\/create.blade.php<\/h5>\n<pre >\n@props([&#039;id&#039;, &#039;modes&#039; =&gt; [],])\n&lt;x-feature :id=&#039;$id&#039;&gt;\n  &lt;x-slot:x_attributes&gt; \/\/ x-feature\u306b\u6e21\u3059\u5c5e\u6027\u306bblade\u306e\u5f0f\u3092\u5165\u308c\u3089\u308c\u306a\u3044\u3002\u305d\u3046\u3044\u3046\u30c7\u30fc\u30bf\u3092\u6e21\u3059\u305f\u3081\u306e\u30b9\u30ed\u30c3\u30c8\n    x-data=&quot;{\n      ...Material.makeCreatePanel(), \/\/ \u30e2\u30b8\u30e5\u30fc\u30eb\u9593\u3067\u5171\u901a\u3059\u308b\u51e6\u7406\u3092\u307e\u3068\u3081\u308b\u3002material.js\n      row_template: @js([  \/\/ \u521d\u671f\u5024\n        &#039;created_at&#039; =&gt; date(&#039;ymd&#039;),\n        &#039;owner&#039; =&gt; auth()-&gt;user()-&gt;name\n      ]),\n      \/\/ \u8868\u578b\u306e\u30d5\u30a9\u30fc\u30e0\u3067\u793a\u3055\u308c\u3066\u3044\u308b\u5217\u540d\n      formColumns: @js(array_keys($tableDefinition-&gt;columns(&#039;create&#039;))),\n      \/\/ \u7a7a\u884c\u306e\u5224\u5b9a\u3092\u3059\u308b\u5217\n      requiredColumns: @js($tableDefinition-&gt;requiredColumns()),\n      \/\/ \u5165\u529b\u30d5\u30a9\u30fc\u30e0\u306e\u8868\u793a\u30e2\u30fc\u30c9\n      mode: &#039;{{ count($modes) &gt; 0 ? $modes[0] : &#039;form&#039; }}&#039;,\n    }&quot;\n \n    x-init=&quot;\n      ensureTrailingEmptyRow();\n \n      \/\/ rows\u306e\u4e2d\u8eab\u3092\u76e3\u8996\u3059\u308b\n      $watch(&#039;rows&#039;, () =&gt; {\n        ensureTrailingEmptyRow();\n      }, { deep: true }); \/* \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5185\u90e8\u306e\u5909\u66f4\u3092\u691c\u77e5\u3059\u308b\u305f\u3081\u306b deep: true \u304c\u5fc5\u9808 *\/\n    &quot;\n  &lt;\/x-slot:x_attributes&gt;\n \n  {{-- \u30c6\u30ad\u30b9\u30c8\u30a8\u30ea\u30a2\u304b\u3089\u306e\u4e00\u62ec\u633f\u5165\u3092\u5fc5\u8981\u3068\u3057\u306a\u3044\u5834\u5408\u306b\u5099\u3048\u308b --}}\n  @if(count($modes) &gt; 0) {{ $mode_selector }} @endif\n \n  {{-- \u8868\u578b\u306e\u5165\u529b\u30d5\u30a9\u30fc\u30e0 --}}\n  &lt;div\n    x-show=&quot;mode === &#039;form&#039;&quot;\n  &gt;\n    &lt;table class=&#039;material-list border-t-2 border-b-2 border-x my-2&#039;&gt;\n      &lt;thead&gt;\n        {{-- thead 1\u884c\u76ee \u898b\u51fa\u3057 --}}\n        &lt;tr class=&#039;&#039;&gt;\n          @foreach($tableDefinition-&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;row in rows&quot; :key=&quot;row.id&quot;&gt;\n          &lt;tr&gt;\n            @foreach($tableDefinition-&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;row.{{ $key }}&quot; placeholder=&quot;{{ $col[&#039;placeholder&#039;] ?? &#039;&#039; }}&quot;&gt;\n              &lt;\/td&gt;\n            @endforeach\n          &lt;\/tr&gt;\n        &lt;\/template&gt;\n      &lt;\/tbody&gt;\n    &lt;\/table&gt;\n \n    &lt;button :disabled=&quot;rows.length &lt;= 1&quot;\n      @click.prevent=&quot;\n        fetch(url.store, {\n          method: &#039;POST&#039;,\n          headers: {\n            &#039;Content-Type&#039;: &#039;application\/json&#039;,\n            &#039;Accept&#039;: &#039;application\/json&#039;,\n            &#039;X-CSRF-TOKEN&#039;: &#039;{{ csrf_token() }}&#039;\n          },\n          body: JSON.stringify({\n            items: rows.filter(row =&gt; ! isRowEmpty(row))\n          })\n        })\n          .then(response =&gt; response.json())\n          .then(data =&gt; {\n            console.log(&#039;data.created:&#039;, data.created);\n            rows = [];\n            return append(data.created.map(item =&gt; {\n              item.checked = true;\n              return item;\n            }));\n          });\n      &quot;\n    &gt;\n      \u8ffd\u52a0\n    &lt;\/button&gt;\n  &lt;\/div&gt;\n  {{ $slot }}\n&lt;\/x-feature&gt;\n<\/pre>\n<\/div>\n<\/p>\n<div class='code'>\n  <h5 class=\"source-file\">resources\/views\/components\/material\/edit.blade.php<\/h5>\n<pre >\n@props([&#039;id&#039;,])\n&lt;x-feature :id=&#039;$id&#039;&gt;\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\u7de8\u96c6\u5bfe\u8c61\u306e\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  &lt;table class=&#039;material-list border-t-2 border-b-2 my-2&#039;\n    x-show=&quot;hasChecked()&quot;\n  &gt;\n    &lt;thead&gt;\n      &lt;tr class=&#039;&#039;&gt;\n        &lt;th&gt;&lt;\/th&gt;\n        @foreach($tableDefinition-&gt;columns(&#039;edit&#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;!-- \u691c\u7d22\u7d50\u679c --&gt;\n      &lt;template x-for=&quot;item in getCheckedItems()&quot; :key=&quot;item.id&quot;&gt;\n        &lt;tr\n          @input.debounce.500=&quot;\n            item.status = &#039;loading&#039;;\n            try{\n              fetch(\n                url = `${url.edit}\/${item.id}`,\n                {\n                  method: &#039;PUT&#039;,\n                  headers: {\n                    &#039;Content-Type&#039;: &#039;application\/json&#039;,\n                    &#039;Accept&#039;: &#039;application\/json&#039;,\n                    &#039;X-CSRF-TOKEN&#039;: &#039;{{ csrf_token() }}&#039;,\n                  },\n                  body: JSON.stringify(item)\n                }\n              )\n              .then(response =&gt; response.json())\n              .then(data =&gt; {\n                console.log(&#039;data:&#039;, data);\n                item.status = data.status;\n              });\n            }catch(e){\n              item.status = &#039;error&#039;;\n            }\n            setTimeout(() =&gt; item.status = null, 2000);\n          &quot;\n        &gt;\n          &lt;td class=&quot;status-cell min-w-10&quot;&gt;\n            &lt;x-ajax-state var=&#039;item&#039; \/&gt;\n          &lt;\/td&gt;\n \n          @foreach($tableDefinition-&gt;columns(&#039;edit&#039;) as $key =&gt; $col)\n            &lt;td class=&quot;{{ $col[&#039;class&#039;] }}&quot;&gt;\n              &lt;input x-model=&quot;item.{{ $key }}&quot; placeholder=&quot;{{ $col[&#039;placeholder&#039;] ?? &#039;&#039; }}&quot;&gt;\n            &lt;\/td&gt;\n          @endforeach\n        &lt;\/tr&gt;\n      &lt;\/template&gt;\n    &lt;\/tbody&gt;\n  &lt;\/table&gt;\n&lt;\/x-feature&gt;\n<\/pre>\n<\/div>\n<\/p>\n<div class='code'>\n  <h5 class=\"source-file\">resources\/views\/components\/material\/table-th.blade.php<\/h5>\n<pre >\n@props([\n  &#039;column&#039; =&gt; [&#039;label&#039; =&gt; &#039;&#039;, &#039;class&#039; =&gt; &#039;&#039;],\n])\n&lt;th {{ $attributes-&gt;merge([&#039;class&#039; =&gt; $column[&#039;class&#039;]]) }}\n&gt;\n  {{ $column[&#039;label&#039;] }}\n&lt;\/th&gt;\n<\/pre>\n<\/div>\n<p>material\u4ee5\u4e0b\u3092x-material.index\u306e\u3088\u3046\u306b\u547c\u3073\u51fa\u3059\u3088\u3046\u306b\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u56fa\u6709\u306e\u30d3\u30e5\u30fc\u3092\u4fee\u6b63\u3002<\/p>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">resources\/views\/oligo\/index.blade.php<\/h5>\n<pre >\n@extends(&quot;$module_id.module&quot;)\n@section(&#039;feature&#039;)\n  &lt;x-material.index id=&#039;{{ $feature_id }}&#039; :items=&quot;$items&quot;\/&gt;\n@endsection\n<\/pre>\n<\/div>\n<\/p>\n<div class='code'>\n  <h5 class=\"source-file\">resources\/views\/oligo\/create.blade.php<\/h5>\n<pre >\n@extends(&quot;$module_id.module&quot;)\n@section(&#039;feature&#039;)\n  &lt;x-material.create id=&#039;{{ $feature_id }}&#039;\n    :modes=&quot;[&#039;paste&#039;, &#039;form&#039;]&quot;\n  &gt;\n    {{-- \u8868\u578b\u306e\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u306f material\/create.blade.php\u306b\u6301\u3063\u3066\u3044\u3063\u305f\u306e\u3067\u3001\n         \u30c6\u30ad\u30b9\u30c8\u8cbc\u308a\u4ed8\u3051\u306e\u65b9\u6cd5\u3060\u3051\u3092\u3053\u3053\u306b\u66f8\u304f\u3002\n    --}}\n    &lt;x-slot:mode_selector&gt;\n      &lt;div class=&quot;flex gap-2 my-2&quot;&gt;\n        \u5165\u529b\u65b9\u6cd5 (\u73fe\u5728\u5024: &lt;span x-text=&quot;mode&quot;&gt;&lt;\/span&gt;)\n        &lt;input type=&#039;radio&#039; name=&#039;mode&#039; id=&#039;mode-paste&#039; value=&#039;paste&#039; checked x-model=&#039;mode&#039;&gt;\n        &lt;label for=&#039;mode-paste&#039;&gt;\u8cbc\u308a\u4ed8\u3051&lt;\/label&gt;\n        &lt;input type=&#039;radio&#039; name=&#039;mode&#039; id=&#039;mode-form&#039;  value=&#039;form&#039; x-model=&#039;mode&#039;&gt;\n        &lt;label for=&#039;mode-form&#039;&gt;\u30d5\u30a9\u30fc\u30e0&lt;\/label&gt;\n      &lt;\/div&gt;\n    &lt;\/x-slot:mode_selector&gt;\n \n    {{-- \u30bf\u30d6\u307e\u305f\u306f\u30ab\u30f3\u30de\u533a\u5207\u308a\u306e\u30c6\u30ad\u30b9\u30c8\u3092\u8cbc\u308a\u4ed8\u3051\u308b\u5834\u6240 --}}\n    &lt;div x-show=&quot;mode == &#039;paste&#039;&quot;\n      x-data=&quot;{\n        raw: &#039;&#039;,\n        parse() {\n          if (!this.raw.trim()) return;\n \n          this.raw.trim().split(&#039;\\n&#039;).map(l =&gt; addRow(l.split(\/[\\t,]\/)));\n          ensureTrailingEmptyRow();\n \n          if(rows.length &gt; 0){\n            mode = &#039;form&#039;;  \/\/ \u30d5\u30a9\u30fc\u30e0\u8868\u793a\u306b\u5207\u308a\u66ff\u3048\u308b\n          }\n          return;\n        }\n      }&quot;\n      x-init=&quot;\n        if(0){ \/\/ \u30c7\u30d0\u30c3\u30b0\u7528\u306b\u30c7\u30fc\u30bf\u3092\u5165\u529b\u3057\u305f\u72b6\u614b\u306b\u3059\u308b\n          raw = &#039;Oligo1\\tACTGG\\nOligo2\\tAGGCCCT&#039;;\n          parse();\n        }\n      &quot;\n    &gt;\n      &lt;p&gt;\u540d\u524d\u3068\u914d\u5217\u3092\u3001\u30bf\u30d6\u307e\u305f\u306f\u30ab\u30f3\u30de\u3067\u533a\u5207\u3063\u3066\u3001\u4e00\u884c\u306b\u4e00\u3064\u305a\u3064\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002&lt;\/p&gt;\n      &lt;textarea class=&quot;border w-full min-w-0 my-2 p-1 h-[10rem] font-mono text-sm&quot;\n        placeholder=&quot;{{ &quot;name\\tsequence&quot; }}&quot;\n        x-model=&quot;raw&quot;\n        @change=&quot;parse()&quot;\n      &gt;&lt;\/textarea&gt;\n \n      &lt;button :disabled=&quot;!raw.trim()&quot; @click.prevent=&quot;parse()&quot;&gt;\n        \u8cbc\u308a\u4ed8\u3051\u305f\u30c7\u30fc\u30bf\u3092\u30d5\u30a9\u30fc\u30e0\u306b\u53cd\u6620\n      &lt;\/button&gt;\n    &lt;\/div&gt;\n  &lt;\/x-material.create&gt;\n@endsection\n<\/pre>\n<\/div>\n<\/p>\n<div class='code'>\n  <h5 class=\"source-file\">resources\/views\/oligo\/edit.blade.php<\/h5>\n<pre >\n@extends(&quot;$module_id.module&quot;)\n@section(&#039;feature&#039;)\n  &lt;x-material.edit id=&#039;{{ $feature_id }}&#039;\/&gt;\n@endsection\n<\/pre>\n<\/div>\n<p>\u8907\u6570\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5207\u308a\u66ff\u3048\u3092\u3067\u304d\u308b\u3088\u3046\u306b selectModule \u3092\u4f5c\u6210\u3002<\/p>\n<p><\/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(moudleId, event){\n        \/* a\u30bf\u30b0\u306ehref\u5c5e\u6027\u304b\u3089module\u306eid\u3092\u53d6\u5f97\u3059\u308b *\/\n        const a = event.currentTarget;\n        const url = a.href;\n \n        \/* activeModule\u306bid\u3092\u8a2d\u5b9a *\/\n        this.activeModule = moudleId;\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        \/* id\u3067\u8981\u7d20\u3092\u53d6\u5f97 *\/\n        const panel = document.getElementById(moudleId);\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        if(null == panel) {\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; + moudleId,\n            }\n          });\n        }\n      }\n    }&quot;\n  &gt;\n    &lt;nav class=&#039;bg-yellow-100 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;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          &#039;user&#039; =&gt; [&#039;label&#039; =&gt; &#039;\u30e6\u30fc\u30b6\u30fc&#039;, &#039;active&#039; =&gt; &#039;bg-user&#039;, &#039;inactive&#039; =&gt; &#039;hover:bg-user-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              @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<p>\u30e2\u30b8\u30e5\u30fc\u30eb\u306bfragment\u3092\u8a2d\u5b9a\u3002\nselectFeature\u306e\u5f15\u6570\u3092feature_id\u306b\u5909\u66f4\u3057\u3066\u3001\u30af\u30ea\u30c3\u30af\u5143\u306ea\u30bf\u30b0\u3068\u306f\u95a2\u4fc2\u306a\u304f\u30bf\u30d6\u3092\u5909\u66f4\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u3002\nhtmx.ajax\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u30d8\u30c3\u30c0\u30fc\u306bHX-Target\u3092\u8a2d\u5b9a\u3057\u3001\u53d6\u5f97\u3059\u308b\u30d3\u30e5\u30fc\u306e\u7bc4\u56f2\u3092\u6307\u5b9a\u3059\u308b\u3002<\/p>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">resources\/views\/components\/module.blade.php<\/h5>\n<pre >\n@props([&#039;id&#039;])\n@fragment(&quot;module-{$id}&quot;)  {{-- module\u306e\u90e8\u5206HTML\u306e\u7bc4\u56f2\u3092\u793a\u3059 --}}\n  &lt;div id=&quot;{{ $id }}&quot; role=&quot;tabpanel&quot;\n    {{ $attributes-&gt;merge([\n      &#039;class&#039; =&gt; &#039;module-panel&#039;,\n      &#039;x-show&#039; =&gt; &quot;activeModule === \\$el.id&quot;\n    ]) }}\n    x-data=&quot;{\n      activeFeature: &#039;{{ $feature_id }}&#039;,\n \n      \/* activeFeature\u306e\u5024\u3092\u5909\u66f4\u3057\u3001\u305d\u306eHTML\u8981\u7d20\u304c\u306a\u3044\u3068\u304d\u306b\u53d6\u5f97\u3059\u308b *\/\n      selectFeature(featureId, event){\n        \/* a\u30bf\u30b0\u306ehref\u5c5e\u6027\u304b\u3089feature\u306eid\u3092\u53d6\u5f97\u3059\u308b *\/\n        const a = event.currentTarget;\n        const url = a.href;\n \n        \/* activeFeature\u306bid\u3092\u8a2d\u5b9a *\/\n        this.activeFeature = featureId;\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        \/* id\u3067\u8981\u7d20\u3092\u53d6\u5f97 *\/\n        const panel = document.getElementById(featureId);\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        if(null == panel) {\n          htmx.ajax(&#039;GET&#039;, url, {\n            target: &#039;#{{ $id }} div.features&#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;feature-&#039; + featureId,\n            }\n          });\n        }\n      }\n    }&quot;\n  &gt;\n    {{ $slot }}\n&lt;\/div&gt;\n@endfragment\n<\/pre>\n<\/div>\n<p>create.blade.php\u304b\u3089blade\u3092\u57cb\u3081\u8fbc\u3093\u3060x-data\u3092\u30b9\u30ed\u30c3\u30c8\u7d4c\u7531\u3067\u53d7\u3051\u53d6\u308b\u305f\u3081\u306e\u4fee\u6b63\u3002<\/p>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">resources\/views\/components\/feature.blade.php<\/h5>\n<pre >\n@props([&#039;id&#039;])\n@fragment(&quot;feature-{$id}&quot;)  {{-- feature\u306e\u90e8\u5206HTML\u306e\u7bc4\u56f2\u3092\u793a\u3059 --}}\n  &lt;div id=&quot;{{ $id }}&quot; role=&quot;tabpanel&quot;\n    {{ $attributes-&gt;merge([\n      &#039;class&#039; =&gt; &#039;feature-panel&#039;,\n      &#039;x-show&#039; =&gt; &quot;activeFeature === \\$el.id&quot;\n    ]) }}\n    @if(isset($x_attributes)) {{ $x_attributes }} @endif\n  &gt;\n    {{ $slot }}\n  &lt;\/div&gt;\n@endfragment\n<\/pre>\n<\/div>\n<h3>CSS\u306e\u8abf\u6574<\/h3>\n<p>\u30e2\u30b8\u30e5\u30fc\u30eb\u3054\u3068\u306b\u8272\u3092\u8a2d\u5b9a\u3059\u308b\u305f\u3081\u3001app.css\u306b\u8272\u306e\u5b9a\u7fa9\u3092\u52a0\u3048\u308b\u3002<\/p>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">resources\/css\/app.css<\/h5>\n<pre >\n@import &#039;tailwindcss&#039;;\n \n@source &#039;..\/..\/vendor\/laravel\/framework\/src\/Illuminate\/Pagination\/resources\/views\/*.blade.php&#039;;\n@source &#039;..\/..\/storage\/framework\/views\/*.php&#039;;\n \n@theme {\n    --font-sans: &#039;Instrument Sans&#039;, ui-sans-serif, system-ui, sans-serif, &#039;Apple Color Emoji&#039;, &#039;Segoe UI Emoji&#039;,\n        &#039;Segoe UI Symbol&#039;, &#039;Noto Color Emoji&#039;;\n \n        \/* \u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u8272\u306e\u8a2d\u5b9a *\/\n    --color-oligo: #0891B2;\n    --color-oligo-light: #22D3EE;\n}\n \n@import &#039;lab.css&#039;;\n@import &#039;oligo.css&#039;;\n@import &#039;user.css&#039;;\n<\/pre>\n<\/div>\n<h3>material.js\u306e\u4f5c\u6210<\/h3>\n<p>\u9577\u304f\u306a\u3063\u305fAlpine.js\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u751f\u6210\u3092material.js\u306b\u66f8\u304d\u51fa\u3059\u3002<\/p>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">resources\/js\/material.js<\/h5>\n<pre >\n\/* create.blade.php\u3067\u4f7f\u7528\u3059\u308bx-data *\/\nfunction makeCreatePanel()\n{\n    return {\n        id: 1,  \/\/ \u3053\u306eid\u306frows\u306e\u4e2d\u3067\u306e\u307f\u6709\u52b9\u3002template x-for\u3067\u30ad\u30fc\u304c\u3042\u3063\u305f\u307b\u3046\u304c\u4fbf\u5229\u306a\u306e\u3067\u3001\u91cd\u8907\u3057\u306a\u3044\u5024\u3092\u3064\u304f\u308b\u3002\n        rows:[],\n \n        isRowEmpty(row) {\n          return this.requiredColumns.every(col =&gt; !row[col] || row[col] === &#039;&#039;);\n        },\n \n        \/\/ \u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\n        addRow(values) {\n            if (this.rows.length &gt; 50) return; \/\/ \u30d0\u30b0\u306b\u3088\u3063\u3066\u884c\u6570\u304c\u5897\u3048\u3059\u304e\u306a\u3044\u305f\u3081\u306e\u5b89\u5168\u88c5\u7f6e\n \n            let row;\n            const lastRow = this.rows[this.rows.length - 1];\n \n            if(lastRow &amp;&amp; this.isRowEmpty(lastRow)){\n                Object.assign(lastRow, this.row_template);\n                row = lastRow;\n            }else{\n                row = { ...this.row_template, id: this.id ++};\n                this.rows.push(row);\n            }\n            values.forEach((v, i) =&gt; {\n                if(this.formColumns[i]) {\n                    row[this.formColumns[i]] = v;\n                }\n            });\n        },\n        \/\/ \u6700\u7d42\u884c\u306b\u5e38\u306b\u7a7a\u884c\u3092\u3044\u308c\u308b\n        ensureTrailingEmptyRow() {\n            const lastRow = this.rows[this.rows.length - 1];\n            if (!lastRow || !this.isRowEmpty(lastRow)) {\n                this.addRow([]);\n            }\n        },\n    };\n}\n \n\/* module.blade.php\u3067\u4f7f\u7528\u3059\u308bx-data *\/\nfunction makeModulePanel() \n{\n    return {\n        items: [],\n        query: {},\n \n        \/\/ \u691c\u7d22 fetch\u306f\u975e\u540c\u671f(async)\u306b\u5b9f\u884c\u3055\u308c\u308b\u306e\u3067\u3001\u305d\u308c\u306b\u305d\u308d\u3048\u308b\n        async search(){\n            const parameter = new URLSearchParams();  \/\/ \u540c\u3058x-data\u5185\u306a\u306e\u3067 this.query\u3068\u306a\u308b\u3002\u3053\u308c\u3092GET\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc(?key1=value1&amp;key2=value2)\u306b\u5909\u63db\u3059\u308b\n \n            Object.entries(this.query).forEach(([key, value]) =&gt; {\n                if (value !== null &amp;&amp; typeof value === &#039;object&#039;) {\n                    \/\/ \u30cd\u30b9\u30c8\u3055\u308c\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08value \u3068 mode \u306a\u3069\uff09\u3092\u30d6\u30e9\u30b1\u30c3\u30c8\u8a18\u6cd5 name[value], name[mode] \u306b\u5c55\u958b\n                    Object.entries(value).forEach(([subKey, subValue]) =&gt; {\n                        if (subValue !== &#039;&#039; &amp;&amp; subValue !== null) {\n                            parameter.append(`${key}[${subKey}]`, subValue);\n                        }\n                    });\n                } else if (value !== &#039;&#039; &amp;&amp; value !== null) {\n                    \/\/ \u901a\u5e38\u306e\u6587\u5b57\u5217\u30fb\u6570\u5024\n                    parameter.append(key, value);\n                }\n            });\n \n            console.log(&#039;search parameter was constructed:&#039;, parameter.toString());  \/\/ \u52d5\u4f5c\u78ba\u8a8d\n            const options = {\n                method: &#039;GET&#039;,\n                headers: {\n                    &#039;Accept&#039;: &#039;application\/json&#039;,  \/\/ \u8fd4\u308a\u5024\u306e\u8a2d\u5b9a\u3002Laravel\u304c\u5224\u65ad\u3059\u308b\u306e\u306b\u4f7f\u3046\u3002\n                    &#039;Content-Type&#039;: &#039;application\/json&#039;,\n                },\n            };\n \n            return fetch(this.url.search + &#039;?&#039; + parameter.toString(), options)\n                .then(response =&gt; response.json())\n                .then(response =&gt; {\n                    console.log(&#039;search done&#039;, response);  \/\/ \u52d5\u4f5c\u78ba\u8a8d\n                    return this.append(response.items);  \/\/ items\u3092\u7f6e\u304d\u63db\u3048\u308bappend\u3092\u547c\u3076\n                })\n                .catch(error =&gt; {console.log(error)})\n            ;\n        },\n \n        \/\/ \u691c\u7d22\u7d50\u679c\u3092items\u306b\u53cd\u6620\u3055\u305b\u308b\u3002\u4eca\u5f8c\u3001\u65b0\u3057\u3044\u691c\u7d22\u7d50\u679c\u3067\u7f6e\u304d\u63db\u3048\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u8ffd\u52a0\u3059\u308b\u3088\u3046\u306b\u4fee\u6b63\u3057\u3066\u3044\u304f\u306e\u3067\u3001append\u3068\u3057\u3066\u3042\u308b\u3002\n        append(appendedItems){\n            const checkedIds = new Set(this.getCheckedItems().map(item =&gt; item.id));\n            const additional = appendedItems.filter(item =&gt; ! checkedIds.has(item.id));\n            console.log(&#039;current items:&#039;, this.items.length, &#039;checked:&#039;, checkedIds.length, &#039;added:&#039;, appendedItems.length);\n            this.items = [...this.getCheckedItems(), ...additional];\n            return additional;\n        },\n \n        \/\/ \u30c1\u30a7\u30c3\u30af\u304c\u3044\u308c\u3089\u308c\u305f\u3082\u306e\u3060\u3051\u3092\u53d6\u5f97\u3059\u308b\u3002\n        getCheckedItems(){\n            return this.items.filter(item =&gt; item.checked);\n        },\n        hasChecked(){\n            return this.getCheckedItems().length &gt; 0;\n        },\n \n        resetQuery(){\n            this.query = JSON.parse(JSON.stringify(this.query_template));            \n        }\n    }\n}\n \n\/\/ window \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b Material \u3092\u5b9a\u7fa9\u3059\u308b\nwindow.Material = {\n    makeModulePanel,\n    makeCreatePanel,\n}\n<\/pre>\n<\/div>\n<p>\u3053\u308c\u3092app.js\u3067\u8aad\u307f\u8fbc\u3080\u3002\n@import \u3067 .\/material \u3068\u3059\u308b\u3002<\/p>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">resources\/js\/app.js<\/h5>\n<pre >\nimport &#039;.\/material&#039;;\n \n\/\/ htmx \u306e\u8aad\u307f\u8fbc\u307f\u3068\u30b0\u30ed\u30fc\u30d0\u30eb\u767b\u9332\nimport htmx from &#039;htmx.org&#039;;\nwindow.htmx = htmx;\n \n\/\/ Alpine.js \u306e\u8aad\u307f\u8fbc\u307f\u3068\u521d\u671f\u5316\nimport Alpine from &#039;alpinejs&#039;;\nwindow.Alpine = Alpine;\n \nAlpine.start();\n<\/pre>\n<\/div>\n<h2>\u7a2e\u5b50\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u4f5c\u6210<\/h2>\n<h3>\u6a29\u9650\u306e\u8ffd\u52a0<\/h3>\n<p>permissions\u306bseed.read\u3068seed.write\u3092\u8ffd\u52a0\u3057\u3001\u9069\u5f53\u306arole\u306b\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<h3>\u30eb\u30fc\u30c8\u306e\u4f5c\u6210<\/h3>\n<p>routes\/oligo.php\u3092\u30b3\u30d4\u30fc\u3057\u3066routes\/seed.php\u3092\u4f5c\u6210\u3059\u308b\u3002\n\u3053\u308c\u3092web.php\u3067\u8aad\u307f\u8fbc\u3080\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">routes\/seed.php<\/h5>\n<pre >\n&lt;?php\n \nuse Illuminate\\Support\\Facades\\Route;\nuse App\\Http\\Controllers\\SeedController as Controller;\n \n\/\/ \u7a2e\u5b50\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\n$module = &#039;seed&#039;;\nRoute::prefix(&quot;\/$module&quot;)\n    -&gt;middleware([&#039;auth&#039;, &#039;verified&#039;, &quot;can:$module.read&quot;])\n    -&gt;as(&quot;web.$module.&quot;)\n    -&gt;group(function (){\n        Route::get(&#039;\/&#039;, [Controller::class, &#039;index&#039;])-&gt;name(&#039;index&#039;);\n        Route::get(&#039;\/search&#039;, [Controller::class, &#039;search&#039;])-&gt;name(&#039;search&#039;);\n        Route::get(&#039;\/create&#039;, [Controller::class, &#039;create&#039;])-&gt;name(&#039;create&#039;);\n        Route::get(&#039;\/edit&#039;, [Controller::class, &#039;edit&#039;])-&gt;name(&#039;edit&#039;);\n \n        \/\/ \u7de8\u96c6\u30d5\u30a9\u30fc\u30e0\u3068\u30c7\u30fc\u30bf\u66f4\u65b0\n        Route::post(&#039;\/&#039;, [Controller::class, &#039;store&#039;])-&gt;name(&#039;store&#039;);\n        Route::put(&#039;\/{item}&#039;, [Controller::class, &#039;update&#039;])-&gt;name(&#039;update&#039;);\n    });\n<\/pre>\n<\/div>\n<h3>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u3001\u30b5\u30fc\u30d3\u30b9\u3001<\/h3>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u30b3\u30d4\u30fc\u3057\u3066\u3044\u304f<\/p>\n<div class='console'><pre>\ncd app\/Http\/Requests\nfor F in Oligo*.php ; do\n    sed -e \"s\/Oligo\/Seed\/g\" -e \"s\/oligo\/seed\/g\" $F >${F\/Oligo\/Seed}\ndone\n<\/pre><\/div>\n<h3>\u30c6\u30fc\u30d6\u30eb\u5b9a\u7fa9<\/h3>\n<p>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3002<\/p>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">database\/migrations\/2026_09_01_000001_create_seeds_table.php<\/h5>\n<pre >\n&lt;?php\n \nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n \nreturn new class extends Migration\n{\n    private const SEQUENCE = &#039;lab_id&#039;;\n \n    \/**\n     * Run the migrations.\n     *\/\n    public function up(): void\n    {\n        Schema::create(&#039;seeds&#039;, function (Blueprint $table) {\n            $table-&gt;integer(&#039;id&#039;)\n                -&gt;primary()\n                -&gt;default(DB::raw(&quot;nextval(&#039;&quot; . self::SEQUENCE . &quot;&#039;)&quot;));\n            $table-&gt;integer(&#039;mother&#039;)-&gt;nullable();  \/\/ plant id \u5916\u90e8\u30ad\u30fc\u306e\u8a2d\u5b9a\u3092\u3059\u308b\u3068\u3044\u308d\u3044\u308d\u3068\u3084\u3084\u3053\u3057\u304f\u306a\u308b\u306e\u3067\u904b\u7528\u3067\u30ab\u30d0\u30fc\u3059\u308b\n            $table-&gt;integer(&#039;father&#039;)-&gt;nullable();  \/\/ plant id\n            $table-&gt;string(&#039;labo_id&#039;)-&gt;nullable();  \/\/ \u7814\u7a76\u5ba4\u72ec\u81ea\u306eID\u3092\u4f7f\u3063\u3066\u3044\u308b\u5834\u5408\u306b\u5bfe\u5fdc\n            $table-&gt;string(&#039;strain&#039;);\n            $table-&gt;string(&#039;generation&#039;)-&gt;nullable();\n            $table-&gt;string(&#039;no&#039;)-&gt;nullable();\n            $table-&gt;string(&#039;box&#039;)-&gt;nullable();      \/\/ \u80b2\u6210\u5834\u6240\n            $table-&gt;string(&#039;owner&#039;)-&gt;nullable();    \/\/ \u6240\u6709\u8005\n            $table-&gt;string(&#039;note&#039;)-&gt;nullable();\n            $table-&gt;timestamps();       \/\/ created_at, updated_at\n            $table-&gt;softDeletes();       \/\/ deleted_at\n        });\n    }\n \n    \/**\n     * Reverse the migrations.\n     *\/\n    public function down(): void\n    {\n        Schema::dropIfExists(&#039;seeds&#039;);\n    }\n};\n<\/pre>\n<\/div>\n<p>\u5b9f\u884c<\/p>\n<div class='console'><pre>\n# .\/artisan migrate\n<\/pre><\/div>\n<p>\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\n<\/p>\n<div class='code'>\n  <h5 class=\"source-file\">app\/Models\/Seed.php<\/h5>\n<pre >\n&lt;?php\n \nnamespace App\\Models;\n \nuse Illuminate\\Database\\Eloquent\\Model;\nuse Illuminate\\Database\\Eloquent\\SoftDeletes;\nuse Illuminate\\Database\\Eloquent\\Attributes\\Fillable;\nuse Illuminate\\Database\\Eloquent\\Casts\\Attribute;\nuse App\\Traits\\ConvertsYmdDate;\n \n#[Fillable([&#039;strain&#039;, &#039;generation&#039;, &#039;no&#039;, &#039;box&#039;, &#039;owner&#039;, &#039;note&#039;, &#039;mother&#039;, &#039;father&#039;, &#039;created_at&#039;, &#039;labo_id&#039;])]\nclass Seed extends Model\n{\n    use SoftDeletes;\n    use ConvertsYmdDate;\n \n    \/\/  \u8868\u793a\u3057\u306a\u3044(toArray, json\u306a\u3069\u3067\u51fa\u529b\u3055\u308c\u306a\u3044)\n    protected $hidden = [&#039;updated_at&#039;, &#039;deleted_at&#039;];\n    protected function createdAt(): Attribute\n    {\n        return Attribute::make(\n            get: function ($value, $attributes) {\n                return isset($attributes[&#039;created_at&#039;])\n                    ? $this-&gt;dateToYmd($attributes[&#039;created_at&#039;])\n                    : null;\n            },\n            set: function ($value) {\n                return [&#039;created_at&#039; =&gt; $value ? $this-&gt;ymdToDate($value) : null];\n            },\n        );\n    }\n}\n<\/pre>\n<\/div>\n<p>\u30c6\u30fc\u30d6\u30eb\u306e\u60c5\u5831\u3092\u96c6\u7d04\u3002<\/p>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">app\/TableDefinitions\/SeedTableDefinition.php<\/h5>\n<pre >\n&lt;?php\n \nnamespace App\\TableDefinitions;\n \nclass SeedTableDefinition extends AbstractTableDefinition\n{\n    protected array $columns = [\n        &#039;strain&#039; =&gt; [\n            \/\/ HTML\u306etable\u306b\u304a\u3044\u3066\u3053\u306e\u5217\u3092\u8868\u793a\u3059\u308b\u30d5\u30a3\u30fc\u30c1\u30e3\u30fc\n            &#039;features&#039; =&gt; [&#039;index&#039;, &#039;create&#039;, &#039;edit&#039;, &#039;delete&#039;],\n            \/\/ \u5217\u540d th\n            &#039;label&#039; =&gt; &#039;\u30b5\u30f3\u30d7\u30eb\u540d&#039;,\n            \/\/ \u30af\u30e9\u30b9 th\u307e\u305f\u306ftd\u3067\u4f7f\u7528\n            &#039;class&#039; =&gt; &#039;strain&#039;,\n            \/\/ input\u306eplacehoder\u5c5e\u6027\n            &#039;form&#039; =&gt; [\n                &#039;placeholder&#039; =&gt; &#039;Col&#039;,\n            ],\n            \/\/ \u691c\u7d22\u65b9\u6cd5\n            &#039;search&#039; =&gt; [\n                &#039;type&#039; =&gt; &#039;likeOrRegex&#039;,\n                &#039;mode&#039; =&gt; [&#039;like&#039;, &#039;regex&#039;],\n                &#039;rule&#039; =&gt; &#039;nullable|string|max:255&#039;, \/\/ OligoSearchReqest\u3067\u4f7f\u7528\n            ],\n            &#039;insert&#039; =&gt; [\n                \/\/ OligoReqest\u3067\u4f7f\u7528\u3002HTML\u306etable\u3067\u7a7a\u884c\u5224\u5b9a\u306b\u3082\u4f7f\u7528\n                &#039;rule&#039; =&gt; [&#039;required&#039;, &#039;string&#039;, &#039;max:255&#039;],\n            ]\n        ],\n \n        &#039;generation&#039; =&gt; [\n            &#039;features&#039; =&gt; [&#039;index&#039;, &#039;create&#039;, &#039;edit&#039;, &#039;delete&#039;],\n            &#039;label&#039; =&gt; &#039;\u4e16\u4ee3&#039;,\n            &#039;class&#039; =&gt; &#039;generation&#039;,\n            &#039;form&#039; =&gt; [\n                &#039;placeholder&#039; =&gt; &#039;F1&#039;,\n            ],\n            &#039;search&#039; =&gt; [\n                &#039;type&#039; =&gt; &#039;like&#039;,\n                &#039;rule&#039; =&gt; [&#039;nullable&#039;, &#039;string&#039;, &#039;max:255&#039;],\n            ],\n            &#039;insert&#039; =&gt; [\n                &#039;rule&#039; =&gt; [&#039;nullable&#039;, &#039;string&#039;, &#039;max:255&#039;],\n            ]\n        ],\n \n        &#039;no&#039; =&gt; [\n            &#039;features&#039; =&gt; [&#039;index&#039;, &#039;create&#039;, &#039;edit&#039;, &#039;delete&#039;],\n            &#039;label&#039; =&gt; &#039;\u500b\u4f53\u756a\u53f7&#039;,\n            &#039;class&#039; =&gt; &#039;no&#039;,\n            &#039;form&#039; =&gt; [\n                &#039;placeholder&#039; =&gt; &#039;1:10&#039;,\n            ],\n            &#039;search&#039; =&gt; [\n                &#039;type&#039; =&gt; &#039;like&#039;,\n                &#039;rule&#039; =&gt; [&#039;nullable&#039;, &#039;string&#039;, &#039;max:255&#039;],\n            ],\n            &#039;insert&#039; =&gt; [\n                &#039;rule&#039; =&gt; [&#039;nullable&#039;, &#039;string&#039;, &#039;max:255&#039;],\n            ]\n        ],\n        &#039;created_at&#039; =&gt; [\n            &#039;features&#039; =&gt; [&#039;index&#039;, &#039;create&#039;, &#039;edit&#039;, &#039;delete&#039;],\n            &#039;label&#039; =&gt; &#039;\u53ce\u7a6b\u65e5&#039;,\n            &#039;class&#039; =&gt; &#039;date6&#039;,\n            &#039;form&#039; =&gt; [\n                &#039;placeholder&#039; =&gt; &quot;260101&quot;,\n                &#039;title&#039;=&gt;&quot;6\u6841\u306e\u6570\u5b57\u3067\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002-\u3067\u7bc4\u56f2\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002&quot;,\n            ],\n            &#039;search&#039; =&gt; [\n                &#039;type&#039; =&gt; &#039;date6&#039;,\n            ],            \n            &#039;insert&#039; =&gt; [\n                &#039;rule&#039; =&gt; [&#039;nullable&#039;, &#039;string&#039;, &#039;regex:\/^[0-9]{6}$\/&#039;],\n            ],\n        ],\n        &#039;owner&#039; =&gt; [\n            &#039;features&#039; =&gt; [&#039;index&#039;, &#039;create&#039;, &#039;edit&#039;, &#039;delete&#039;],\n            &#039;label&#039; =&gt; &#039;\u53ce\u7a6b\u8005&#039;,\n            &#039;class&#039; =&gt; &#039;owner&#039;,\n            &#039;form&#039; =&gt; [\n                &#039;placeholder&#039; =&gt; &quot;\u9234\u6728&quot;,\n            ],\n            &#039;search&#039; =&gt; [\n                &#039;type&#039; =&gt; &#039;like&#039;,\n                &#039;rule&#039; =&gt; &#039;nullable|string|max:255&#039;,\n            ],\n            &#039;insert&#039; =&gt; [\n                &#039;rule&#039; =&gt; [&#039;nullable&#039;, &#039;string&#039;, &#039;max:100&#039;],\n            ]\n        ],\n        &#039;note&#039; =&gt; [\n            &#039;features&#039; =&gt; [&#039;index&#039;, &#039;create&#039;, &#039;edit&#039;, &#039;delete&#039;],\n            &#039;label&#039; =&gt; &#039;\u5099\u8003&#039;,\n            &#039;class&#039; =&gt; &#039;note&#039;,\n            &#039;form&#039; =&gt; [\n                &#039;placeholder&#039; =&gt; &quot;&quot;,\n            ],\n            &#039;search&#039; =&gt; [\n                &#039;type&#039; =&gt; &#039;like&#039;,\n                &#039;rule&#039; =&gt; &#039;nullable|string|max:255&#039;,\n            ],\n            &#039;insert&#039; =&gt; [\n                &#039;rule&#039; =&gt; [&#039;nullable&#039;, &#039;string&#039;, &#039;max:100&#039;],\n            ]\n        ],\n        &#039;mother&#039; =&gt; [\n            &#039;features&#039; =&gt; [],\n            &#039;label&#039; =&gt; &#039;mother_id&#039;,\n            &#039;class&#039; =&gt; &#039;parent&#039;,\n            &#039;form&#039; =&gt; [\n                &#039;placeholder&#039; =&gt; &quot;\u9234\u6728&quot;,\n            ],\n            &#039;search&#039; =&gt; [\n                &#039;type&#039; =&gt; &#039;none&#039;,\n                &#039;rule&#039; =&gt; &#039;nullable|integer&#039;,\n            ],\n            &#039;insert&#039; =&gt; [\n                &#039;rule&#039; =&gt; [&#039;nullable&#039;, &#039;integer&#039;],\n            ]\n        ],\n        &#039;father&#039; =&gt; [\n            &#039;features&#039; =&gt; [],\n            &#039;label&#039; =&gt; &#039;father_id&#039;,\n            &#039;class&#039; =&gt; &#039;parent&#039;,\n            &#039;form&#039; =&gt; [\n                &#039;placeholder&#039; =&gt; &quot;\u9234\u6728&quot;,\n            ],\n            &#039;search&#039; =&gt; [\n                &#039;type&#039; =&gt; &#039;none&#039;,\n                &#039;rule&#039; =&gt; &#039;nullable|integer&#039;,\n            ],\n            &#039;insert&#039; =&gt; [\n                &#039;rule&#039; =&gt; [&#039;nullable&#039;, &#039;integer&#039;],\n            ]\n        ],\n        \/* \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c6\u30fc\u30d6\u30eb\u3067\u306f\u3064\u304f\u3063\u3066\u3042\u308b\u3002\n            &#039;labo_id&#039; =&gt; &#039;nullable|string|max:255&#039;,\n            &#039;box&#039; =&gt; &#039;nullable|string|max:255&#039;,\n        *\/\n    ];\n}\n<\/pre>\n<\/div>\n<h3>\u30d3\u30e5\u30fc<\/h3>\n<div class='console'><pre>\n$ cd resources\/views\n$ cp -r oligo seed\n<\/pre><\/div>\n<p>layouts\/app.blade.php\u3092\u4fee\u6b63\u3057\u3066\u3001\u7a2e\u5b50\u306e\u9805\u76ee\u3092\u8ffd\u52a0\u3002<\/p>\n<h3>CSS<\/h3>\n<p>app.css\u306b\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30c6\u30fc\u30de\u30ab\u30e9\u30fc\u3092\u3064\u304f\u308b\u3002<\/p>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">resources\/css\/app.css<\/h5>\n<pre >\n@import &#039;tailwindcss&#039;;\n \n@source &#039;..\/..\/vendor\/laravel\/framework\/src\/Illuminate\/Pagination\/resources\/views\/*.blade.php&#039;;\n@source &#039;..\/..\/storage\/framework\/views\/*.php&#039;;\n \n@theme {\n    --font-sans: &#039;Instrument Sans&#039;, ui-sans-serif, system-ui, sans-serif, &#039;Apple Color Emoji&#039;, &#039;Segoe UI Emoji&#039;,\n        &#039;Segoe UI Symbol&#039;, &#039;Noto Color Emoji&#039;;\n    \n    \/* \u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u8272\u306e\u8a2d\u5b9a *\/\n    --color-oligo: #0891B2;\n    --color-oligo-light: #22D3EE;\n    --color-seed: #ee852a;\n    --color-seed-light: #ffb370;\n}\n \n@import &#039;lab.css&#039;;\n@import &#039;oligo.css&#039;;\n@import &#039;seed.css&#039;;\n@import &#039;user.css&#039;;\n<\/pre>\n<\/div>\n<p>\u305d\u308c\u3092\u4f7f\u3046\u3002<\/p>\n<p><\/p>\n<div class='code'>\n  <h5 class=\"source-file\">resources\/css\/seed.css<\/h5>\n<pre >\n#seed {\n    table {\n        @apply border-seed;\n \n        thead tr:first-child {\n            @apply bg-seed-light;\n        }\n \n        thead th,thead td {\n            @apply border-x border-seed;\n        }\n \n        tr {\n            @apply border-seed;\n        }\n \n        td {\n            @apply border-x border-seed p-1;\n        }\n        td input {\n            &amp;[type=text], &amp;:not([type]) {\n                @apply border border-seed w-full min-w-0 px-1 h-[24px];\n            }  \n        }\n \n        .strain {\n            width: 10em;\n        }\n        .generation, .no {\n            width: 4em;\n        }\n        .owner {\n            width: 5em;\n        }\n        .date6, .created_at, .updated_at {\n            width: 5em;\n        }\n        .note {\n            width: 15em;\n        }\n    }\n \n    button {\n        @apply border-seed bg-seed-light;\n        &amp;:hover {\n            @apply bg-seed text-white;\n        }\n    }\n}\n<\/pre>\n<\/div>\n<h2>\u690d\u7269\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u4f5c\u6210<\/h2>\n<p>\u80b2\u6210\u4e2d\u306e\u690d\u7269\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3002\u6b21\u306e\u7a2e\u306e\u5143\u306b\u306a\u308b\u3002<\/p>\n<p>\u30eb\u30fc\u30c8\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u3001\u30b5\u30fc\u30d3\u30b9\u3001\u30d3\u30e5\u30fc(CSS\u3092\u542b\u3080)\u306f\u7a2e\u5b50\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u5897\u3084\u3057\u305f\u3068\u304d\u3068\u540c\u3058\u3002<\/p>\n<p>migration\u3067\u30c6\u30fc\u30d6\u30eb\u306e\u5b9a\u7fa9\u3092\u3064\u304f\u308a\u3001Model\/Plant\u3092\u3064\u304f\u3063\u3066\u3001PlantTableDefinition\u3067\u30d3\u30e5\u30fc\u3084\u30ea\u30af\u30a8\u30b9\u30c8\u3068\u306e\u95a2\u4fc2\u3092\u3064\u304f\u308b\u3002<\/p>\n<h2>\u30e9\u30d9\u30eb\u5370\u5237\u7528CSV\u306e\u51fa\u529b<\/h2>\n<p>P-touch\u3068\u3044\u3046\u30e9\u30d9\u30eb\u30d7\u30ea\u30f3\u30bf\u304c\u3042\u308a\u307e\u3059\u3002\n\u3053\u308c\u306fCSV\u306e\u30c7\u30fc\u30bf\u3092\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306b\u3042\u3066\u306f\u3081\u3066\u5370\u5237\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u7a2e\u5b50\u888b\u3084\u690d\u7269\u306e\u9262\u306b\u3064\u3051\u308b\u30e9\u30d9\u30eb\u3092\u3064\u304f\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u306e\u305f\u3081\u306b\u3001\u9078\u629e\u3057\u305f\u30c7\u30fc\u30bf\u306eCSV\u3092\u51fa\u529b\u3059\u308b\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30eb\u30fc\u30c8\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc<\/h3>\n<p>Seed\u306e\u307b\u3046\u3092\u66f8\u304d\u307e\u3059\u304c\u3001Plant\u306b\u3082\u540c\u3058\u3082\u306e\u3092\u3044\u308c\u308b\u3068\u3088\u3044\u3067\u3059\u3002<\/p>\n<p><code>routes\/seed.php<\/code>\u3068<code>app\/Http\/Controllers\/MaterialController.php<\/code>\u306blabel\u6a5f\u80fd\u3078\u306e\u30eb\u30fc\u30c8\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\n\u5b9f\u969b\u306e\u51e6\u7406\u306f\u30b5\u30fc\u30d3\u30b9\u306b\u59d4\u306d\u307e\u3059\u3002\nCSV\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u306b\u306fPOST\u3078\u306e\u5fdc\u7b54\u304c\u697d\u3067\u3059\u3002<\/p>\n<div class='code'>\n  <h5 class=\"source-file\">routes\/seed.php<\/h5>\n<pre >\n&lt;?php\n \nuse Illuminate\\Support\\Facades\\Route;\nuse App\\Http\\Controllers\\SeedController as Controller;\n \n\/\/ \u7a2e\u5b50\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\n$module = &#039;seed&#039;;\nRoute::prefix(&quot;\/$module&quot;)\n    -&gt;middleware([&#039;auth&#039;, &#039;verified&#039;, &quot;can:$module.read&quot;])\n    -&gt;as(&quot;web.$module.&quot;)\n    -&gt;group(function (){\n        Route::get(&#039;\/&#039;, [Controller::class, &#039;index&#039;])-&gt;name(&#039;index&#039;);\n        Route::get(&#039;\/search&#039;, [Controller::class, &#039;search&#039;])-&gt;name(&#039;search&#039;);\n        Route::get(&#039;\/create&#039;, [Controller::class, &#039;create&#039;])-&gt;name(&#039;create&#039;);\n        Route::get(&#039;\/edit&#039;, [Controller::class, &#039;edit&#039;])-&gt;name(&#039;edit&#039;);\n \n        Route::post(&#039;\/&#039;, [Controller::class, &#039;store&#039;])-&gt;name(&#039;store&#039;);\n        Route::put(&#039;\/{item}&#039;, [Controller::class, &#039;update&#039;])-&gt;name(&#039;update&#039;);\n    });\n<\/pre>\n<\/div>\n<div class='code'>\n  <h5 class=\"source-file\">app\/Http\/Controllers\/MaterialController.php<\/h5>\n<pre >\n&lt;?php\n \nnamespace App\\Http\\Controllers;\n \nuse Illuminate\\Http\\Request;\n \nclass MaterialController\n{\n    \/* \u30ea\u30af\u30a8\u30b9\u30c8\u30af\u30e9\u30b9\u306f\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u3068\u3057\u3066\u578b\u6307\u5b9a\u3057\u3001Laravel\u304c\u81ea\u52d5\u7684\u306b\u6e21\u3059\u3088\u3046\u306b\u3057\u3066\u3044\u305f\u3002\n     * \u305d\u306e\u5834\u5408\u3001\u57fa\u5e95\u30af\u30e9\u30b9\u3067\u30e1\u30bd\u30c3\u30c9\u3092\u5171\u901a\u5316\u3059\u308b\u3068\u578b\u3092\u6307\u5b9a\u3067\u304d\u306a\u304f\u306a\u308a\u3001\u6d3e\u751f\u30af\u30e9\u30b9\u3067\u30e1\u30bd\u30c3\u30c9\u5f15\u6570\u3092\u6307\u5b9a\u3059\u308b\u3068\n     * \u57fa\u5e95\u30af\u30e9\u30b9\u306e\u30e1\u30bd\u30c3\u30c9\u3092__parent::method()\u3068\u3057\u3066\u547c\u3070\u306a\u3044\u3068\u3044\u3051\u306a\u304f\u306a\u308b\u3002\n     * \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u5b50\u30af\u30e9\u30b9\u3067\u30e1\u30bd\u30c3\u30c9\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u306a\u304f\u3001\u4f7f\u7528\u3059\u308b\u30ea\u30af\u30a8\u30b9\u30c8\u30af\u30e9\u30b9\u3092\u5909\u66f4\u3059\u308b\u305f\u3081\u306b\u3001\n     * \u3053\u3053\u3067\u30ea\u30af\u30a8\u30b9\u30c8\u30af\u30e9\u30b9\u306e\u540d\u524d\u3092\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3068\u3057\u3066\u8a2d\u5b9a\u3059\u308b\u3002\n     * \u30ea\u30af\u30a8\u30b9\u30c8\u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3067\u306f\u3001\u30af\u30e9\u30b9\u540d\u304b\u3089app(class_name)\u3067\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3059\u308b\u3002\n     * \u30ea\u30af\u30a8\u30b9\u30c8\u30af\u30e9\u30b9\u306fnew\u3067\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3059\u308b\u3068\u3084\u3084\u3053\u3057\u3044\u306e\u3067\u3001Laravel\u306e\u3057\u304f\u307f\u3092\u4f7f\u3046\u3002\n     *\/\n    protected string $singleRequest = Request::class;\n    protected string $multiRequest = Request::class;\n    protected string $queryRequest = Request::class;\n \n    \/\/ \u30e2\u30c7\u30eb($model)\u3068\u30b5\u30fc\u30d3\u30b9($service)\u306f\u5b50\u30af\u30e9\u30b9\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3067\u578b\u6307\u5b9a\u3059\u308b\n    \n    \/*\n     * \u30ea\u30af\u30a8\u30b9\u30c8\u306b\u5fdc\u3058\u3066\u30d3\u30e5\u30fc\u3092\u8fd4\u3059\u90e8\u5206\u3092\u5171\u901a\u5316\u3059\u308b\n     *\/\n    public function respond($data = [], $view = null){\n        \/\/ \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u56fa\u6709\u306e\u30eb\u30fc\u30c8\u306b\u3060\u3051\u5bfe\u5fdc\u3055\u305b\u308c\u3070\u3088\u3044\u306e\u3067\u3001\n        \/\/ app\/Providers\/AppServiceProvider.php\u3067\u3084\u3063\u3066\u3044\u305f\u51e6\u7406\u3092\u3053\u3053\u306b\u3082\u3063\u3066\u304d\u305f\n        $route_name = request()-&gt;route()-&gt;getName();\n        list($module, $feature) = array_slice(explode(&#039;.&#039;, $route_name), 1, 2);\n        view()-&gt;share([\n            &#039;module_id&#039; =&gt; $module,\n            &#039;feature_id&#039; =&gt; &quot;$module-$feature&quot;,\n            \/\/ \u30c6\u30fc\u30d6\u30eb(Model)\u306e\u30ab\u30e9\u30e0\u306e\u6271\u3044\u3092\u4e00\u5143\u5316\u3057\u305ftableDefinition\u3092\u3064\u304f\u308a\u3001\u305d\u308c\u3092\u30d3\u30e5\u30fc\u306b\u6e21\u3059\n            &#039;tableDefinition&#039; =&gt; $this-&gt;service-&gt;tableDefinition,\n        ]);\n \n        \/\/ htmx\u304b\u3089\u306e\u90e8\u5206HTML\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u5bfe\u5fdc\u3059\u308b\n        if($fragment = request()-&gt;hasHeader(&#039;HX-Request&#039;)){\n            $fragment = request()-&gt;header(&#039;HX-Target&#039;);\n        }\n        return view(&quot;$module.$feature&quot;, $data)\n            -&gt;fragmentIf($fragment, $fragment)\n        ;\n    }\n \n    \/*\n     * POST\u3001PUT\u306a\u3069JSON\u3067\u3084\u308a\u53d6\u308a\u3059\u308b\u3068\u304d\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\n     *\/\n    public function json($data = [], $code = 200)\n    {\n        if($code == 200){\n            $status = &#039;success&#039;;\n        }else {\n            $status = &#039;error&#039;;\n        }\n        return response()-&gt;json(array_merge([&#039;status&#039; =&gt; $status], $data), $code);\n    }\n \n    \/\/ GET\u30ea\u30af\u30a8\u30b9\u30c8(\u30d3\u30e5\u30fc\u3092\u8fd4\u3059)\n    public function index(){\n        return $this-&gt;respond([&#039;items&#039; =&gt; $this-&gt;model-&gt;limit(10)-&gt;get()]);\n    }\n \n    public function create(){\n        return $this-&gt;respond();\n    }\n \n    public function edit(){\n        return $this-&gt;respond();\n    }\n \n    \/\/ \u691c\u7d22\n    public function search()\n    {\n        try{\n            \/\/ app(\u30af\u30e9\u30b9\u540d)\u3068\u3059\u308b\u3053\u3068\u3067\u3001Laravel\u304c\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u3064\u304f\u308b\u3002\n            \/\/ \u4ee5\u5f8c\u306f request() \u3067queryRequest\u30af\u30e9\u30b9\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u8fd4\u3063\u3066\u304f\u308b\n            $query = app($this-&gt;queryRequest)-&gt;validated();\n            return $this-&gt;json($this-&gt;service-&gt;search($query), 200);\n        }catch(\\Throwable $e){\n            return $this-&gt;json([&#039;message&#039; =&gt; $e-&gt;getMessage()], 400);\n        }\n    }\n \n    \/\/ \u8ffd\u52a0\n    public function store()\n    {\n        try{\n            $items = app($this-&gt;multiRequest)-&gt;valids;\n            return $this-&gt;json($this-&gt;service-&gt;create($items), 200);\n        }catch(\\Throwable $e){\n            return $this-&gt;json([&#039;message&#039; =&gt; $e-&gt;getMessage()], 400);\n        }\n    }\n \n    \/\/ \u66f4\u65b0\n    public function update(int $id){\n        try{\n            $data = app($this-&gt;singleRequest)-&gt;validated();\n            $item = $this-&gt;model-&gt;findOrFail($id)-&gt;update($data);\n            return $this-&gt;json([&#039;item&#039; =&gt; $item], 200);\n        }catch(\\Throwable $e){\n            return response()-&gt;json([&#039;status&#039; =&gt; &#039;error&#039;, &#039;message&#039; =&gt; $e-&gt;getMessage()], 400);\n        }\n    }\n}\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-07'>\u524d\u3078<\/a>\n\n<a href='.\/'>PHP\u306e\u5b66\u7fd2 \u76ee\u6b21<\/a>\n\n  <a href='laravel-09'>\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":8,"comment_status":"closed","ping_status":"closed","template":"page-programming.php","meta":{"footnotes":""},"class_list":["post-3270","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/pages\/3270","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=3270"}],"version-history":[{"count":23,"href":"https:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/pages\/3270\/revisions"}],"predecessor-version":[{"id":3295,"href":"https:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/pages\/3270\/revisions\/3295"}],"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=3270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}