Closed nicolasvahidzein closed 3 months ago
The problem is the laravel phpdoc. query
is annotated to return Illuminate\Database\Eloquent\Builder
so any association the builder has with Order
is lost. Using https://github.com/barryvdh/laravel-ide-helper helps somewhat as it can generate a query
phpdoc method on models, but even then the types it provides are inaccurate.
Another workaround is to correct the type of $ordersProcessing
with an annotation.
/** @var \Illuminate\Database\Eloquent\Collection<int, \App\Models\Order> $ordersProcessing */
$ordersProcessing = ...
This code works great but getting this error somehow.
Expected type 'string|Stringable'. Found 'Illuminate\Database\Eloquent\Builder'.