Two badges, not four: the package is not on Packagist yet, so there is no registry version to show, and there is no static-analysis workflow.
Handy helper generators for Laravel e-commerce projects — auto-generate unique SKUs, order numbers, and ticket numbers on your Eloquent models via the
HasSku,HasOrderNumber, andHasTicketNumbertraits, each configurable globally or per model and fully replaceable.
Compatible with PHP ^8.4.1 || ^8.5 and Laravel 12 or 13.
composer require simtabi/lacommerceThe service provider is auto-discovered and the defaults work without a config file. Give each model the
destination column its trait writes to (sku, order_number or ticket_number) in your own migration.
To change the defaults, publish the config to config/simtabi/lacommerce.php:
php artisan vendor:publish --tag=simtabi::lacommerce-configuse Illuminate\Database\Eloquent\Model;
use Simtabi\Lacommerce\Traits\HasSku;
class Product extends Model
{
use HasSku;
}
$product = Product::create(['name' => 'Laravel is Awesome']);
echo $product->sku; // "LAR-8056449213"use Illuminate\Database\Eloquent\Model;
use Simtabi\Lacommerce\Traits\HasOrderNumber;
class Order extends Model
{
use HasOrderNumber;
}
echo Order::create(['name' => 'Web order'])->order_number; // "ORD-3920571846"To generate a value without a model, call Identifiers directly:
use Simtabi\Lacommerce\Supports\Identifiers;
Identifiers::sku('Laravel is Awesome'); // "LAR-8056449213"
Identifiers::orderNumber('INV', '/'); // "INV/3920571846"
Identifiers::ticketNumber('Support'); // "SUP-1749302865"The full walkthrough is in docs/getting-started.md; everything else is in the Documentation index.
Full documentation is at opensource.simtabi.com/documentation/simtabi/lacommerce — installation, getting started, each generator trait, and configuration.
The SKU-generation approach builds on Cyrill Kalita / binary-cats' work, plus all contributors.
Issues and PRs are welcome — see CONTRIBUTING.md. Report vulnerabilities per SECURITY.md (security@simtabi.com); participation follows the Code of Conduct.
MIT © Simtabi LLC. See LICENSE.