SparePartInventoryController.php 791 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Services\SparePartInventoryService;
  4. use Illuminate\Http\Request;
  5. class SparePartInventoryController extends Controller
  6. {
  7. protected array $data = [
  8. 'active' => 'spare_parts',
  9. 'title' => 'Контроль наличия запчастей',
  10. 'id' => 'spare_part_inventory',
  11. ];
  12. public function __construct(protected SparePartInventoryService $inventoryService)
  13. {
  14. }
  15. public function index(Request $request)
  16. {
  17. $this->data['critical_shortages'] = $this->inventoryService->getCriticalShortages();
  18. $this->data['below_min_stock'] = $this->inventoryService->getBelowMinStock();
  19. $this->data['tab'] = 'inventory';
  20. return view('spare_parts.index', $this->data);
  21. }
  22. }