芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/tblonline.org/vendor/laravel/framework/src/Illuminate/Validation/Rules/Unique.php
ignoreModel($id, $idColumn); } $this->ignore = $id; $this->idColumn = $idColumn ?? 'id'; return $this; } /** * Ignore the given model during the unique check. * * @param \Illuminate\Database\Eloquent\Model $model * @param string|null $idColumn * @return $this */ public function ignoreModel($model, $idColumn = null) { $this->idColumn = $idColumn ?? $model->getKeyName(); $this->ignore = $model->{$this->idColumn}; return $this; } /** * Ignore soft deleted models during the unique check. * * @param string $deletedAtColumn * @return $this */ public function withoutTrashed($deletedAtColumn = 'deleted_at') { $this->whereNull($deletedAtColumn); return $this; } /** * Convert the rule to a validation string. * * @return string */ public function __toString() { return rtrim(sprintf('unique:%s,%s,%s,%s,%s', $this->table, $this->column, $this->ignore ? '"'.addslashes($this->ignore).'"' : 'NULL', $this->idColumn, $this->formatWheres() ), ','); } }