Generate your first SKU in three steps. See the Documentation index.
composer require simtabi/lacommerce
php artisan vendor:publish --tag=simtabi::lacommerce-configSee Installation.
Add HasSku to a model that has an sku column:
use Simtabi\Lacommerce\Traits\HasSku;
use Illuminate\Database\Eloquent\Model;
class Product extends Model
{
use HasSku;
}$product = new Product();
$product->name = 'Laravel is Awesome';
$product->save();
echo $product->sku; // "LAR-8056449213"Order numbers and ticket numbers work the same way via HasOrderNumber / HasTicketNumber.
- Generators — all three generators, per-model config, custom generators.
- Configuration — every
config/simtabi/lacommerce.phpkey.