PHPackages                             cleaniquecoders/traitify - 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. cleaniquecoders/traitify

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

cleaniquecoders/traitify
========================

Traitify is a Laravel package designed to streamline and enhance your development process by providing a collection of reusable traits and contracts.

1.3.1(4mo ago)199.2k↑55.6%15MITPHPPHP ^8.2|^8.3|^8.4CI passing

Since Oct 15Pushed 1mo agoCompare

[ Source](https://github.com/cleaniquecoders/traitify)[ Packagist](https://packagist.org/packages/cleaniquecoders/traitify)[ Docs](https://github.com/cleaniquecoders/traitify)[ GitHub Sponsors]()[ RSS](/packages/cleaniquecoders-traitify/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (12)Versions (9)Used By (15)

Traitify
========

[](#traitify)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5a2246945bc8a6d9c089a798673d2312e16c1b6ba06bc073713a4608ed35fda7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c65616e69717565636f646572732f74726169746966792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cleaniquecoders/traitify)[![GitHub Tests Action Status](https://camo.githubusercontent.com/7bdb2a1f627c32ed1f4ad1f461ba6391932993c89207898c8c96cd7060475b94/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636c65616e69717565636f646572732f74726169746966792f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/cleaniquecoders/traitify/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/7bb97102009480c1f7a4290d0a373e6a15d366919fcdbf0b866d78407c9a163a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636c65616e69717565636f646572732f74726169746966792f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/cleaniquecoders/traitify/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/f8cc69e901893da6737ccae402564ef614df1e7620973986fdc97e74e258a797/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c65616e69717565636f646572732f74726169746966792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cleaniquecoders/traitify)

A Laravel package that streamlines development with reusable traits, contracts, and a powerful value generator system. Reduce boilerplate, standardize behavior, and enhance your models with automatic UUID, token, and slug generation.

✨ Features
----------

[](#-features)

- 🔧 **11 Reusable Traits** - UUID, Token, Slug, Meta, User, API, Search, and more
- 🎨 **Customizable Generators** - Flexible token, UUID, and slug generation
- ⚙️ **Three-Tier Configuration** - Model → Config → Default resolution
- 🔌 **Extensible Architecture** - Create custom generators easily
- 📦 **Zero Configuration** - Works out of the box with sensible defaults
- ✅ **100% Tested** - Comprehensive test coverage with Pest PHP

📦 Installation
--------------

[](#-installation)

```
composer require cleaniquecoders/traitify
```

🚀 Quick Start
-------------

[](#-quick-start)

```
use CleaniqueCoders\Traitify\Concerns\InteractsWithUuid;
use Illuminate\Database\Eloquent\Model;

class Post extends Model
{
    use InteractsWithUuid;

    // UUID automatically generated on creation
}
```

```
$post = Post::create(['title' => 'Hello World']);
echo $post->uuid; // 9d9e8da7-78c3-4c9d-9f5e-5c8e4a2b1d3c
```

📚 Documentation
---------------

[](#-documentation)

- **[Documentation Home](docs/README.md)** - Complete documentation index
- **[Getting Started](docs/01-getting-started/README.md)** - Installation and setup
- **[Architecture](docs/02-architecture/README.md)** - System design and patterns
- **[Traits Reference](docs/03-traits/README.md)** - All available traits
- **[Generators](docs/04-generators/README.md)** - Customizable value generation
- **[Configuration](docs/05-configuration/README.md)** - Configuration options
- **[Examples](docs/06-examples/README.md)** - Real-world usage examples
- **[Advanced](docs/07-advanced/README.md)** - Extend and customize

🔥 Popular Use Cases
-------------------

[](#-popular-use-cases)

### Auto-Generate UUIDs

[](#auto-generate-uuids)

```
use InteractsWithUuid;

protected $uuid_column = 'id'; // Use UUID as primary key
```

### Secure API Tokens

[](#secure-api-tokens)

```
use InteractsWithToken;

protected $tokenGeneratorConfig = [
    'length' => 64,
    'prefix' => 'sk_',
    'pool' => 'hex',
];
```

### SEO-Friendly Slugs

[](#seo-friendly-slugs)

```
use InteractsWithSlug;

protected $slugGeneratorConfig = [
    'unique' => true,
    'max_length' => 100,
];
```

🧪 Testing
---------

[](#-testing)

```
composer test
```

📖 Available Traits
------------------

[](#-available-traits)

TraitPurpose`InteractsWithUuid`Auto-generate UUIDs`InteractsWithToken`Generate secure tokens`InteractsWithSlug`Create URL-friendly slugs`InteractsWithMeta`Manage JSON metadata`InteractsWithUser`Auto-assign user relationships`InteractsWithApi`API response formatting`InteractsWithSearchable`Full-text search`InteractsWithDetails`Eager load relationships`InteractsWithEnum`Enum helper methods`InteractsWithResourceRoute`Resource route generation`InteractsWithSqlViewMigration`SQL view migrations🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

🔒 Security
----------

[](#-security)

If you discover any security issues, please review our [security policy](../../security/policy).

📝 Changelog
-----------

[](#-changelog)

Please see [CHANGELOG](CHANGELOG.md) for recent changes.

👥 Credits
---------

[](#-credits)

- [Nasrul Hazim Bin Mohamad](https://github.com/nasrulhazim)
- [All Contributors](../../contributors)

📄 License
---------

[](#-license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance83

Actively maintained with recent releases

Popularity34

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~62 days

Total

8

Last Release

143d ago

PHP version history (3 changes)v1.0.0PHP ^8.2

v1.0.2PHP ^8.2|^8.3

1.1.0PHP ^8.2|^8.3|^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/b57069d0f4b634f65eccc6e5d5848990e25968d45ec2cf46d626c6a4658f944b?d=identicon)[nasrulhazim.m](/maintainers/nasrulhazim.m)

---

Top Contributors

[![nasrulhazim](https://avatars.githubusercontent.com/u/10341422?v=4)](https://github.com/nasrulhazim "nasrulhazim (65 commits)")

---

Tags

laravelphptraituuidlaraveltraitifyCleanique Coders

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/cleaniquecoders-traitify/health.svg)

```
[![Health](https://phpackages.com/badges/cleaniquecoders-traitify/health.svg)](https://phpackages.com/packages/cleaniquecoders-traitify)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.8k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
