---
title: Availability Search for Multiple Entries
sidebar:
  label: Multiple Entries
---

This page shows how to list every entry that's available for the searched dates, like all the rooms free next weekend.

There are three ways to do it:

| You want | Use |
| --- | --- |
| A list that updates as visitors search (recommended) | The [`availability-collection`](#the-availability-collection-component) component |
| A plain list that reloads the page | The [Collection Tag](#collection-tag-server-rendered) |
| Availability as one filter among others, like amenities or price | [Livewire Filters](#livewire-filters-filtering-beyond-dates) |

For a single entry, see [Availability Results](/availability-results), [Availability List](/availability-list) or [Cart Booking](/cart-booking).

## The availability-collection component [#the-availability-collection-component]

The `availability-collection` component shows a card for each available entry, with its price and a booking button. It updates whenever the visitor changes the [`availability-search`](/availability-search-component) next to it.

Use it with a collection, with a list of entry IDs, or with both to show only those entries from the collection. You need at least one of the two.

```antlers
<livewire:availability-search />
<livewire:availability-collection collection="rooms" />

<livewire:availability-collection :entries="['id-1', 'id-2', 'id-3']" />
```

With rates, prices sorted cheapest first, and 12 entries per page:

```antlers
<livewire:availability-search :rates="true" :any-rate="true" />
<livewire:availability-collection
    collection="rooms"
    :rates="true"
    :show-rates="true"
    sort="price"
    :paginate="12"
/>
```

{/* Screenshot not captured yet (public/img/resrv-availability-collection.webp is missing): <Frame caption="The availability-collection component showing a grid of available entries for the searched dates."> */}

### Properties

| Property | Default | Description |
| --- | --- | --- |
| `collection` | | The collection's handle. |
| `entries` | `[]` | Entry IDs. With `collection`, only these entries from it are shown. |
| `rates` | `false` | Show rate labels. |
| `showRates` | `false` | List every available rate per entry, each with its price and button. Otherwise each entry shows one "from" price. |
| `showUnavailable` | `false` | Also show sold out entries, marked "No availability". |
| `paginate` | | Entries per page. |
| `sort` | `order` | How entries are ordered: `order` (the collection's order), `title` or `price` (cheapest first). |
| `rateSorting` | `order` | How each entry's rates are ordered: `order` (as in [Rates](/rates)) or `price`. The first rate gives the "from" price. |
| `overrideRates` | `[]` | Your own `rate_id => label` map for rate labels. |
| `view` | `availability-collection` | A custom view. |

With `paginate`, prices are checked one page at a time, so `sort="price"` sorts within each page.

### When a visitor books

If the entry has its own page, the visitor goes there, and the page's [`availability-results`](/availability-results) already has their dates. If it doesn't, Resrv creates the reservation and takes them straight to [checkout](/checkout).

[Cutoff](/cutoff) rules aren't checked in the list, only when the visitor books.

### Customizing the view

Publish the views:

```bash
php artisan vendor:publish --tag=resrv-checkout-views
```

Then edit `resources/views/vendor/statamic-resrv/livewire/availability-collection.blade.php`, or set your own with `view="my-view"`. The view gets:

- `$this->rows`: one row per entry, with its `id`, `entry`, `available`, its `from` rate, and every available rate in `rates`. Each rate has `price`, `original_price`, `payment`, `rate_id`, `rateLabel` and `cancellation_policy`.
- `$this->resolvedEntries`: the entries. Call `->links()` on it to show the page links when you paginate.
- `$data`: the visitor's search, like `$data->dates` and `$data->quantity`.

To show a rate's cancellation terms, pass its `cancellation_policy` to `CancellationPolicy::labelFor()`.

## Alternative approaches

### Collection Tag (server-rendered)

If you don't need the list to update live, use Statamic's [Collection Tag](https://statamic.dev/tags/collection) with the `resrv_search` query scope. It leaves out the entries that aren't available:

```antlers {2,5}
<div class="w-96">
    {{ livewire:availability-search calendar="range" live="false" :redirectTo="url" }}
</div>

{{ collection:rooms as="rooms" query_scope="resrv_search" resrv_search:resrv_availability="{ session:resrv-search }" }}
    {{ if no_results }}
        <p>No rooms are available for these dates.</p>
    {{ /if }}
    {{ rooms }}
        <a href="{{ url }}">{{ title }}</a>
    {{ /rooms }}
{{ /collection:rooms }}
```

When the visitor presses **Search**, the page reloads with only the available rooms. Always pass the search from the session, as above (`resrv_search:resrv_availability="{ session:resrv-search }"`).

### Livewire Filters (filtering beyond dates)

[Livewire Filters](https://livewirefilters.com), our add-on for filtering Statamic collections, lets visitors filter by almost any field. Use it when availability is one filter among others, like amenities or price.

Once you [install Livewire Filters](https://livewirefilters.com/installation) (`reachweb/statamic-livewire-filters`), Resrv adds an `lf-availability-filter` component. It works like [`availability-search`](/availability-search-component), plus a `blueprint` set to `collection.blueprint`:

```antlers {2-7,10}
<div class="w-96">
    {{ livewire:lf-availability-filter
        blueprint="rooms.room"
        calendar="range"
        enableQuantity="true"
        :rates="true"
    }}
</div>

{{ livewire-collection:rooms query_scope="resrv_search" resrv_search:resrv_availability="{ session:resrv-search }" }}
```

Leave out `:rates="true"` if your entries don't use [Rates](/rates). To change how entries look, edit the Livewire Filters view at `resources/views/vendor/statamic-livewire-filters/livewire/livewire-collection.antlers.html`. See the [Livewire Filters docs](https://livewirefilters.com/overview) for the rest.

### Accessing availability data

With both the Collection Tag and Livewire Filters, each available entry gets a `live_availability` value with:

| Property | Description |
| --- | --- |
| `price` | The total price for the searched dates. |
| `original_price` | The price before [dynamic pricing](/dynamic-pricing). |
| `payment` | What the visitor pays now. |
| `rate_id` and `rateLabel` | The [rate](/rates) and its label, with rates. |
| `cancellation_policy` | The rate's cancellation terms. |

```antlers
{{ rooms }}
    <a href="{{ url }}">
        {{ title }}
        {{ if live_availability }}
            <span>Price: ${{ live_availability:price }}</span>
        {{ /if }}
    </a>
{{ /rooms }}
```

When an entry has several available rates, `live_availability` holds one row per rate, so loop over it.

## Related

- [Availability Search component](/availability-search-component): the search settings these share.
- [Rates](/rates): selling an entry at different prices or terms.
- [Availability Results](/availability-results), [Availability List](/availability-list) and [Cart Booking](/cart-booking): the components for one entry.
