> ## 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.

# PHP

> Use Pictum icon, avatar, QR code, and placeholder helpers with framework-free PHP.

## Installation

Install the PHP package in your project with Composer.

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

## Icons

Render SVG markup directly for HTML output, or use the helper when you also need the icon URL.

<CodeGroup>
  ```php Render theme={null}
  echo Pictum\icon('devicon:php')->svg();
  ```

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

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

## Avatars

Generate realistic or generated avatar URLs with the framework-independent client. Only generated avatars provide canonical SVG markup.

<CodeGroup>
  ```php Render theme={null}
  $pictum = new Pictum\Pictum();

  echo $pictum->avatar('ada-lovelace')->svg();
  ```

  ```php Helper theme={null}
  // Generate the URL without making a request.
  $pictum = new Pictum\Pictum();

  $url = $pictum->avatar(
      'customer-123',
      variant: 'realistic',
      gender: 'female',
  )->url();

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

## QR codes

Render canonical SVG markup directly, or use the helper to select a raster format.

<CodeGroup>
  ```php Render theme={null}
  echo Pictum\qrCode('https://pictum.dev')->svg();
  ```

  ```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

Render a square as canonical SVG markup, or use custom dimensions when you need another aspect ratio.

<CodeGroup>
  ```php Render theme={null}
  echo Pictum\placeholder(
      size: 320,
      background: '#ffffff',
      color: '#6d28d9',
      text: 'Coming soon',
  )->svg();
  ```

  ```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.
