Closed
Description
Laravel Version
11.42.0
PHP Version
8.4.3
Database Driver & Version
No response
Description
Hi,
With the latest update we started to receive these errors.
This scope is a part of the trait that any model can use.
public function scopeSearch(Builder $query, ?string $search = null): Builder
{
return $query->whereHas('user', static function (Builder $query) use ($search): void {
/**
* @var Builder<static> $query
*/
$query->search($search);
});
}
PHPDoc tag @var with type Illuminate\Database\Eloquent\Builder<static(App\Models\Admin)> is not subtype of native type Illuminate\Database\Eloquent\Builder<Illuminate\Database\Eloquent\Model>.
- varTag.nativeType
Steps To Reproduce
Copy this code in a trait and use it on some model.
public function scopeSearch(Builder $query, ?string $search = null): Builder
{
return $query->whereHas('user', static function (Builder $query) use ($search): void {
/**
* @var Builder<static> $query
*/
$query->search($search);
});
}
Metadata
Metadata
Assignees
Labels
No labels