---
title: "Address types — Addresses for Laravel | Roundly"
description: "The AddressType enum — six cases with UI labels — and how to convert untrusted strings from requests safely."
url: https://roundly-consulting.com/open-source/docs/addresses-for-laravel/address-types
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Addresses for Laravel](https://roundly-consulting.com/open-source/docs/addresses-for-laravel.md)

# Address types

type is a string-backed enum, RoundlyConsulting\\Addresses\\Enums\\AddressType. The column stores the backing value and the model casts it back to the enum:

| Case | Value | label() |
| --- | --- | --- |
| `AddressType::Default` | default | Default |
| `AddressType::Billing` | billing | Billing |
| `AddressType::Shipping` | shipping | Shipping |
| `AddressType::Home` | home | Home |
| `AddressType::Work` | work | Work |
| `AddressType::Office` | office | Office |

```php
use RoundlyConsulting\Addresses\Enums\AddressType;

AddressType::Office->value;     // 'office'
AddressType::Office->label();   // 'Office'
AddressType::cases();           // all six cases
AddressType::from('billing');   // AddressType::Billing
```

Types are enum-only across the whole public API — the builder, AddressData, createAddress(), the read helpers, the scopes and the facade all take an AddressType. Passing a plain string such as 'office' is a type error, so upgrade older string-based calls to the matching case.

## From request input

Validate with Laravel’s enum rule, or convert an untrusted string yourself and fail with the package’s typed exception. Apart from a misconfigured default\_type, the package never throws InvalidAddressTypeException itself — it exists for exactly this boundary:

```php
use Illuminate\Validation\Rule;
use RoundlyConsulting\Addresses\Enums\AddressType;
use RoundlyConsulting\Addresses\Exceptions\InvalidAddressTypeException;

// validate with Laravel's enum rule…
$request->validate(['type' => ['required', Rule::enum(AddressType::class)]]);
$type = $request->enum('type', AddressType::class);

// …or convert an untrusted string yourself and fail with the package's typed exception
$type = AddressType::tryFrom($input)
    ?? throw InvalidAddressTypeException::for($input);
```

## Select options

label() returns a fixed English label, handy for a type picker:

```php
use RoundlyConsulting\Addresses\Enums\AddressType;

$options = collect(AddressType::cases())
    ->mapWithKeys(fn (AddressType $type) => [$type->value => $type->label()])
    ->all();
// ['default' => 'Default', 'billing' => 'Billing', 'shipping' => 'Shipping', …]
```

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/addresses-for-laravel.md)
