<?php

namespace App\Services\Units;

use App\Models\Unit;
use Illuminate\Database\Eloquent\Collection;

class OccupancyHistoryService
{
    public function historyForUnit(Unit $unit): Collection
    {
        return $unit->occupancies()
            ->with('user:id,full_name,mobile')
            ->orderByDesc('created_at')
            ->get();
    }
}
