- N+1-Fix Ausschussliste: user.account eager laden (StockDisposalController@index) - Composite-Indizes stock_entries(entry_type,status,ingredient_id/packaging_item_id) für InventoryService-Aggregationen - Ungenutzten Eager-Load producedByUser aus ProductionRepository::listForIndex entfernt - ExampleTest auf assertRedirect umgestellt (Suite 100% grün: 155 Tests) - Query-Count-Regressionstest für die Ausschussliste - Plan V6.0 (Code-Verifikation, OPT-Block, geklärte Kundenfragen) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
21 lines
431 B
PHP
21 lines
431 B
PHP
<?php
|
|
|
|
namespace App\Repositories;
|
|
|
|
use App\Models\Production;
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
|
|
class ProductionRepository
|
|
{
|
|
/**
|
|
* @return Collection<int, Production>
|
|
*/
|
|
public function listForIndex(): Collection
|
|
{
|
|
return Production::query()
|
|
->with(['product', 'location'])
|
|
->orderByDesc('produced_at')
|
|
->orderByDesc('id')
|
|
->get();
|
|
}
|
|
}
|