getKey() && $model->shouldGenerateId()) { $model->setAttribute($model->getKeyName(), app(UniqueIdentifierGenerator::class)->generate($model)); } }); } public function getIncrementing() { return ! app()->bound(UniqueIdentifierGenerator::class); } public function shouldGenerateId(): bool { return ! $this->getIncrementing(); } public function getKeyType() { return $this->shouldGenerateId() ? 'string' : $this->keyType; } }