<?php

namespace App\Services;

use App\Models\AssetUnit;
use App\Models\FacilityObject;
use App\Models\Item;
use Illuminate\Database\Eloquent\Model;

class PublicMaintenanceLookup
{
    public function findByToken(string $token): ?Model
    {
        return Item::query()->where('qr_token', $token)->first()
            ?? AssetUnit::query()->where('qr_token', $token)->first()
            ?? FacilityObject::query()->where('qr_token', $token)->first();
    }
}
