private function isSimple()
{
if ($this->isAwful()) {
return false;
}
if (!$this->wheres) {
return false;
}
if (count($this->wheres) > 1) {
return false;
}
$where = current($this->wheres);
if ($where['type'] === 'Nested') {
return false;
}
$id = $this->model->primaryKey();
$tableId = $this->model->table() . '.' . $this->model->primaryKey();
if (!in_array($where['column'], [$id, $tableId])) {
return false;
}
if ($where['type'] === 'In') {
return true;
}
if ($where['type'] === 'Basic') {
if ($where['operator'] === '=') {
return true;
}
}
return false;
}