<?php

namespace App\Http\Controllers\Concerns;

use App\Services\TenantContext;

/**
 * Use in controllers that previously duplicated getHotelId() / Hotel::first() logic.
 */
trait ResolvesTenantHotel
{
    protected function tenantHotelId(): ?int
    {
        return app(TenantContext::class)->hotelId();
    }

    protected function tenantHotelIdOrAbort(): int
    {
        return app(TenantContext::class)->hotelIdOrAbort();
    }
}
