> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pictum.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Laravel

> Use Pictum icon, avatar, QR code, and placeholder interfaces with Laravel.

## Installation

Install the Laravel package in your application with Composer.

```bash theme={null}
composer require pictum/laravel
```

## Icons

Use the Blade component in views. Use `Pictum\icon()` when application code needs the icon URL or canonical SVG markup.

<CodeGroup>
  ```blade Component theme={null}
  <x-icon
    name="devicon:laravel"
    aria-label="Laravel"
    class="size-6"
  />
  ```

  ```php Helper theme={null}
  // Generate the URL without making a request.
  $url = Pictum\icon('devicon:laravel')->url();

  // Fetch canonical SVG markup.
  $svg = Pictum\icon('devicon:laravel')->svg();
  ```
</CodeGroup>

## Avatars

Use the Blade component for profile images in views. Use `Pictum\avatar()` when application code needs a selected raster URL or canonical SVG.

<CodeGroup>
  ```blade Component theme={null}
  <x-avatar
    seed="ada-lovelace"
    variant="gradient"
    format="webp"
    alt="Ada Lovelace"
    class="size-10"
  />
  ```

  ```php Helper theme={null}
  // Generate the URL without making a request.
  $url = Pictum\avatar(
      'ada-lovelace',
      variant: 'gradient',
      format: 'webp',
  )->url();

  // Fetch canonical SVG markup.
  $svg = Pictum\avatar(
      'ada-lovelace',
      variant: 'gradient',
  )->svg();
  ```
</CodeGroup>

## QR codes

Use the Blade component for scannable text or URLs. Use `Pictum\qrCode()` when application code needs the image URL or canonical SVG.

<CodeGroup>
  ```blade Component theme={null}
  <x-qr-code
    value="https://pictum.dev"
    format="svg"
    aria-label="Open Pictum"
    class="size-32"
  />
  ```

  ```php Helper theme={null}
  // Generate the URL without making a request.
  $url = Pictum\qrCode(
      'https://pictum.dev',
      format: 'png',
  )->url();

  // Fetch canonical SVG markup.
  $svg = Pictum\qrCode('https://pictum.dev')->svg();
  ```
</CodeGroup>

## Placeholders

Use the Blade component for square or custom-dimension images. Use `Pictum\placeholder()` when application code needs the selected image URL or SVG markup.

<CodeGroup>
  ```blade Component theme={null}
  <x-placeholder
    size="320"
    format="webp"
    density="2"
    background="#ffffff"
    color="#6d28d9"
    text="Coming soon"
    alt="Coming soon"
  />
  ```

  ```php Helper theme={null}
  // Generate a custom-dimension URL without making a request.
  $url = Pictum\placeholder(
      width: 640,
      height: 360,
      format: 'webp',
      density: 3,
      text: 'Coming soon',
  )->url();

  // Fetch a square as canonical SVG markup.
  $svg = Pictum\placeholder(
      size: 320,
      text: 'Coming soon',
  )->svg();
  ```
</CodeGroup>

Helpers return the selected representation URL immediately. Calling `svg()` retrieves canonical SVG markup for the same asset.
