workflow()->create([ 'key' => $model->getCheckKey(), ]); }); } public function getCheckKey(): string { if (property_exists($this, 'checkKey')) { return $this->checkKey; } return Str::snake(class_basename(__CLASS__)); } /** * 关联审核流水 */ public function workflow() { return $this->morphOne(WorkflowCheck::class, 'subject'); } }