kawtharstudios/sf15to18

A PHP package to convert a 15 digit Salesforce ID to 18 digits

Maintainers

Package info

github.com/KawtharStudios/sf15to18

pkg:composer/kawtharstudios/sf15to18

Statistics

Installs: 9

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

1.0.2 2026-01-19 00:55 UTC

This package is auto-updated.

Last update: 2026-03-19 01:23:46 UTC


README

Packagist Packagist Downloads Made With

Convert 15-character Salesforce IDs to their 18-character case-insensitive form.

Salesforce “classic” IDs are 15 chars and case-sensitive. The 18-char form adds a 3-character suffix so the ID becomes case-insensitive, which is safer for spreadsheets, exports, and integrations.

Requirements

  • PHP: 8.0+
  • Illuminate Support: illuminate/support ^9 or ^10

Installation

composer require kawtharstudios/sf15to18

Usage

<?php

use KawtharStudios\SF15to18;

$id18 = SF15to18::convert('001550V000WOQZi');
// 001550V000WOQZiACP

Behavior

  • 18-character input: returned unchanged
  • 15-character input: converted to 18 characters
  • Invalid input: throws Exception
<?php

use KawtharStudios\SF15to18;

SF15to18::convert('001550V000WOQZiACP'); // unchanged
SF15to18::convert('not-a-salesforce-id'); // throws

Laravel

This package ships with a Laravel service provider and supports package auto-discovery.

If you’ve disabled discovery, add the provider manually:

KawtharStudios\KawtharStudiosServiceProvider::class,

Testing

./vendor/bin/phpunit

Contributing

  • Bugs: include a minimal reproduction + expected vs actual result
  • PRs: keep changes focused, add/update tests, and update docs when behavior changes

License

MIT — see LICENSE.md.