PHPackages                             pointybeard/laravel-sku - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. pointybeard/laravel-sku

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

pointybeard/laravel-sku
=======================

A Laravel package for generating SKU codes via regular expressions.

01PHP

Since Feb 11Pushed 1y ago1 watchersCompare

[ Source](https://github.com/pointybeard/laravel-sku)[ Packagist](https://packagist.org/packages/pointybeard/laravel-sku)[ RSS](/packages/pointybeard-laravel-sku/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel SKU
===========

[](#laravel-sku)

A Laravel package for generating SKU codes from regular expressions.

Installation
------------

[](#installation)

This library is installed via [Composer](http://getcomposer.org/). To install, use `composer require pointybeard/laravel-sku`.

### Requirements

[](#requirements)

This library requires PHP 8.2 or greater.

Usage
-----

[](#usage)

### Adding SKUs to Models

[](#adding-skus-to-models)

Use the `HasSku` trait in your Eloquent model to automatically generate SKUs. You can customize options like the regex pattern, uniqueness enforcement, and the database column for storing SKUs directly in your model properties.

```
