/** * {@inheritdoc} * * @return \Illuminate\Database\Eloquent\Builder */ protected function newQuery() { $query = parent::newQuery(); if ($this->onlyTrashed === true) { $query->onlyTrashed(); } if ($this->withTrashed === true) { $query->withTrashed(); } return $query; }