'spare_parts', 'title' => 'Контроль наличия запчастей', 'id' => 'spare_part_inventory', ]; public function __construct(protected SparePartInventoryService $inventoryService) { } public function index(Request $request) { $this->data['critical_shortages'] = $this->inventoryService->getCriticalShortages(); $this->data['below_min_stock'] = $this->inventoryService->getBelowMinStock(); $this->data['open_shortages'] = \App\Models\Shortage::query() ->where('status', \App\Models\Shortage::STATUS_OPEN) ->with(['sparePart', 'reclamation']) ->orderBy('created_at', 'asc') ->get(); $this->data['tab'] = 'inventory'; return view('spare_parts.index', $this->data); } }