<?php

namespace App\Http\Controllers\Client;

use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;

class EquipmentController extends Controller
{
    public function index()
    {
        $client = Auth::user()->client;
        $installations = $client
            ? $client->installations()->with(['cameras', 'devices'])->latest()->get()
            : collect([]);

        return view('client.equipment.index', compact('installations'));
    }
}
