> ## Documentation Index
> Fetch the complete documentation index at: https://veekthoven-laravel-inertia-toast-24-61.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Enums

> PHP enum types used in Laravel Inertia Toast

## ToastLevel

Defines the severity level of toast notifications.

### Enum values

<ParamField path="Success" type="string">
  Success level toast. Used for positive confirmation messages.

  **Value:** `'success'`
</ParamField>

<ParamField path="Error" type="string">
  Error level toast. Used for error messages and failures.

  **Value:** `'error'`
</ParamField>

<ParamField path="Info" type="string">
  Info level toast. Used for informational messages.

  **Value:** `'info'`
</ParamField>

<ParamField path="Warning" type="string">
  Warning level toast. Used for warning messages.

  **Value:** `'warning'`
</ParamField>

### Source

```php theme={null}
<?php

namespace InertiaToast\Enums;

enum ToastLevel: string
{
    case Success = 'success';
    case Error = 'error';
    case Info = 'info';
    case Warning = 'warning';
}
```

### Usage examples

<CodeGroup>
  ```php PHP - Direct usage theme={null}
  use InertiaToast\Enums\ToastLevel;
  use InertiaToast\Toaster;

  $toaster = new Toaster();
  $toaster->add('Operation completed', ToastLevel::Success);
  $toaster->add('Something went wrong', ToastLevel::Error);
  ```

  ```php PHP - With facade theme={null}
  use InertiaToast\Facades\Toast;
  use InertiaToast\Enums\ToastLevel;

  Toast::add('Custom message', ToastLevel::Warning, 'Alert', 5000);
  ```

  ```typescript TypeScript - Type equivalent theme={null}
  type ToastLevel = 'success' | 'error' | 'info' | 'warning'

  const level: ToastLevel = 'success'
  ```
</CodeGroup>

<Note>
  The ToastLevel enum is automatically converted to lowercase string values when passed to the frontend.
</Note>

***

## ToastPosition

Defines the screen position where toast notifications appear.

### Enum values

<ParamField path="TopRight" type="string">
  Position toasts in the top right corner of the screen.

  **Value:** `'top-right'`
</ParamField>

<ParamField path="TopLeft" type="string">
  Position toasts in the top left corner of the screen.

  **Value:** `'top-left'`
</ParamField>

<ParamField path="TopCenter" type="string">
  Position toasts in the top center of the screen.

  **Value:** `'top-center'`
</ParamField>

<ParamField path="BottomRight" type="string">
  Position toasts in the bottom right corner of the screen.

  **Value:** `'bottom-right'`
</ParamField>

<ParamField path="BottomLeft" type="string">
  Position toasts in the bottom left corner of the screen.

  **Value:** `'bottom-left'`
</ParamField>

<ParamField path="BottomCenter" type="string">
  Position toasts in the bottom center of the screen.

  **Value:** `'bottom-center'`
</ParamField>

### Source

```php theme={null}
<?php

namespace InertiaToast\Enums;

enum ToastPosition: string
{
    case TopRight = 'top-right';
    case TopLeft = 'top-left';
    case TopCenter = 'top-center';
    case BottomRight = 'bottom-right';
    case BottomLeft = 'bottom-left';
    case BottomCenter = 'bottom-center';
}
```

### Usage examples

<CodeGroup>
  ```php PHP - Configuration theme={null}
  return [
      'position' => 'top-right', // Use the enum value
  ];
  ```

  ```typescript TypeScript - Component prop theme={null}
  import { Toaster } from '@inertiatoast/vue'

  <Toaster position="top-right" />
  ```

  ```typescript TypeScript - React theme={null}
  import { Toaster } from '@inertiatoast/react'

  <Toaster position="bottom-center" />
  ```
</CodeGroup>

<Note>
  The position value is configured in the `config/inertia-toast.php` file and passed to the frontend Toaster component.
</Note>
