-
|
Hello, I am using Nova v3 and just noticed that searching by ID is including one extra query. // vendor/laravel/nova/src/PerformsQueries.php
protected static function applySearch($query, $search)
{
return $query->where(function ($query) use ($search) {
// ...
if ($canSearchPrimaryKey) {
$query->orWhere($model->getQualifiedKeyName(), $search);
}
//...
foreach (static::searchableColumns() as $column) {
$query->orWhere(...);
}
});
}So if you forward
To circumvent, I added a simple foreach (static::searchableColumns() as $column) {
if ($column === $model->getKeyName()) {
continue;
}
$query->orWhere(...);
} |
Beta Was this translation helpful? Give feedback.
Answered by
crynobone
May 4, 2023
Replies: 1 comment
-
|
This is no longer the behavior in Laravel Nova 4. However, this wouldn't be fixed in Laravel Nova 3 as we no longer making any new releases for that version. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Norgul
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is no longer the behavior in Laravel Nova 4. However, this wouldn't be fixed in Laravel Nova 3 as we no longer making any new releases for that version.