Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Perform the actual delete query on this model instance.
- *
- * @return void
- */
- protected function runSoftDelete()
- {
- $query = $this->newQueryWithoutScopes()->where($this->getKeyName()[0], $this->attributes[$this->getKeyName()[0]])
- ->where($this->getKeyName()[1], $this->attributes[$this->getKeyName()[1]]);
- $time = $this->freshTimestamp();
- $columns = [$this->getDeletedAtColumn() => $this->fromDateTime($time)];
- $this->{$this->getDeletedAtColumn()} = $time;
- if ($this->timestamps && ! is_null($this->getUpdatedAtColumn())) {
- $this->{$this->getUpdatedAtColumn()} = $time;
- $columns[$this->getUpdatedAtColumn()] = $this->fromDateTime($time);
- }
- $query->update($columns);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement