/**
* Overriding newQuery() to the custom PostBuilder with some interesting methods
*
* @param bool $excludeDeleted
* @return Corcel\PostBuilder
*/
public function newQuery($excludeDeleted = true)
{
$builder = new PostBuilder($this->newBaseQueryBuilder());
$builder->setModel($this)->with($this->with);
$builder->orderBy('post_date', 'desc');
if (isset($this->postType) and $this->postType) {
$builder->type($this->postType);
}
if ($excludeDeleted and $this->softDelete) {
$builder->whereNull($this->getQualifiedDeletedAtColumn());
}
return $builder;
}