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