getConnection()->getSchemaBuilder()->getColumnListing($this->getTable()); } /** * Exclude an array of elements from the result. * @param Builder $query * @param array $columns * * @return Builder */ public function scopeExclude($query, $columns): \Illuminate\Database\Eloquent\Builder { /** @var Builder $query */ return $query->select(array_diff($this->getTableColumns(), (array) $columns)); } }