{"id":891,"date":"2023-06-08T11:07:09","date_gmt":"2023-06-08T11:07:09","guid":{"rendered":"http:\/\/robinluo.top\/?p=891"},"modified":"2023-06-08T11:11:31","modified_gmt":"2023-06-08T11:11:31","slug":"laraval-%e4%b8%80%e5%af%b9%e5%a4%9a","status":"publish","type":"post","link":"https:\/\/robinluo.top\/?p=891","title":{"rendered":"laravel \u4e00\u5bf9\u591a"},"content":{"rendered":"\n<pre class=\"wp-block-preformatted\">class OctopusRecord extends Model\n{\n    use SoftDeletes;\n    use HasFactory;\n    protected $connection = \"beiko_mysql\";\n    protected $table = 'octopus_records';\n\n    \/\/\u6240\u6709\u5b57\u6bb5\u4e00\u5b9a\u8981\u6ee1\u8db3 \u5c0f\u5199\u4e0b\u5212\u7ebf\u6a21\u5f0f\n    public function triage_tags()\n    {\n        return $this-&gt;hasMany(OctopusRecordTriageTag::class,\"octopus_record_id\");\n    }\n\n}<\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>$form->tab(\"\u5206\u8bca\u4fe1\u606f\",function (Form $subform) {\n            $subform->hasMany('triage_tags', \"\u5206\u8bca\u6807\u7b7e\", function (Form\\NestedForm $nestedForm) {\n                $nestedForm->hidden('id');\n                $nestedForm->select('name', \"\u6807\u7b7e\")->options(TriageTag::all()->pluck('name', 'name'));\n                \/\/$nestedForm->text('name', \"\u6807\u7b7e\");\n            });\n            \/\/->distinctFields(&#91;\"name\"]);\n                \/\/->useTable();\n            \/\/->useTab();;\n            \/\/$form->multipleSelect('triage_tags', \"\u5206\u8bca\u6807\u7b7e\")->options(&#91;0=>\"\u65e0\u6548\",1=>\"\u6709\u6548\"]);\n            \/\/->options(TriageTag::all()->pluck('name', 'name'));\n\n            $subform->textarea('conclusion', __('Conclusion'));\n        });<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>class OctopusRecord extends Model { use SoftDeletes; use HasFactory; protected $connection = &#8220;beiko_mysql&#8221;; protected $table = &#8216;octopus_records&#8217;; \/\/\u6240\u6709\u5b57\u6bb5\u4e00\u5b9a\u8981\u6ee1\u8db3 \u5c0f\u5199\u4e0b\u5212\u7ebf\u6a21\u5f0f public function triage_tags() { return $this-&gt;hasMany(OctopusRecordTriageTag::class,&#8221;octopus_record_id&#8221;); } }<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[144,146],"_links":{"self":[{"href":"https:\/\/robinluo.top\/index.php?rest_route=\/wp\/v2\/posts\/891"}],"collection":[{"href":"https:\/\/robinluo.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/robinluo.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/robinluo.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/robinluo.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=891"}],"version-history":[{"count":2,"href":"https:\/\/robinluo.top\/index.php?rest_route=\/wp\/v2\/posts\/891\/revisions"}],"predecessor-version":[{"id":894,"href":"https:\/\/robinluo.top\/index.php?rest_route=\/wp\/v2\/posts\/891\/revisions\/894"}],"wp:attachment":[{"href":"https:\/\/robinluo.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/robinluo.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=891"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/robinluo.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}