PHPackages                             jobmetric/typeify - 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. jobmetric/typeify

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

jobmetric/typeify
=================

A flexible and extensible type system for managing structured data behaviors in Laravel applications.

1.2.0(4mo ago)1202MITPHPPHP &gt;=8.0.1

Since Jul 25Pushed 4mo agoCompare

[ Source](https://github.com/jobmetric/typeify)[ Packagist](https://packagist.org/packages/jobmetric/typeify)[ Docs](https://jobmetric.github.io/packages/typeify)[ RSS](/packages/jobmetric-typeify/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (4)Versions (4)Used By (2)

[![Contributors](https://camo.githubusercontent.com/1275bfaf13141bbd01136c3c1d2683123cdd5e53aa98365e468b8aabbb3c149d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f6a6f626d65747269632f747970656966792e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/jobmetric/typeify/graphs/contributors)[![Forks](https://camo.githubusercontent.com/a22fd9d87f03be2f267241acd8f0e872edd7f00fdf6a878ef6944f60e9f61048/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6a6f626d65747269632f747970656966792e7376673f7374796c653d666f722d7468652d6261646765266c6162656c3d466f726b)](https://github.com/jobmetric/typeify/network/members)[![Stargazers](https://camo.githubusercontent.com/2b508910ca474522f7f12ce96b0808613bfccca1cd208550391198d616154a07/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6a6f626d65747269632f747970656966792e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/jobmetric/typeify/stargazers)[![MIT License](https://camo.githubusercontent.com/a3d04e8041e70afa651de3192e1b10daf1c28e6123035d4997140b9399a57660/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6a6f626d65747269632f747970656966792e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/jobmetric/typeify/blob/master/LICENCE.md)[![LinkedIn](https://camo.githubusercontent.com/eb590f47a3fca74584d18db8dd3e985ae3d786f50cd41b7530c3af3885da233c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2d4c696e6b6564496e2d626c75652e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d6c696e6b6564696e26636f6c6f72423d353535)](https://linkedin.com/in/majidmohammadian)

Typeify
=======

[](#typeify)

**Define Types. Attach Behavior. Scale Cleanly.**

Typeify simplifies how you define and manage type registries in Laravel. Stop scattering type configs and ad-hoc flags across your codebase—define named types once, attach labels, descriptions, import/export flags, and custom options through a single fluent API. This is where structured type management meets developer-friendly simplicity: one base class, composable traits, and the Laravel container as the single source of truth.

Why Typeify?
------------

[](#why-typeify)

### One Registry Per Concern

[](#one-registry-per-concern)

Keep your type definitions normalized and queryable. Each subclass of `BaseType` is a single registry (e.g. post types, product types, taxonomy types). Define types with unique keys, attach parameters via fluent methods, and read them anywhere in the request lifecycle. No duplicated config arrays or scattered conditionals.

### Composable Behavior with Traits

[](#composable-behavior-with-traits)

- **Labels &amp; Descriptions** – Attach translatable label and description per type (`HasLabelType`, `HasDescriptionType`).
- **Import / Export** – Enable import or export per type with a single flag (`HasImportType`, `HasExportType`).
- **Hierarchical &amp; List Options** – Mark types as hierarchical or control list UI (show description, remove filter, change status) via `HasHierarchicalType` and `HasListOptionType`.
- **Driver Namespaces** – Register custom driver classes per type with `HasDriverNamespaceType`.

Add only the traits you need. Your type classes stay thin and consistent.

### Laravel-Native Storage

[](#laravel-native-storage)

All type data lives in the Laravel service container under the key returned by `typeName()`. The same definitions are available in controllers, APIs, admin panels, and CLI—no extra wiring, no custom globals. Use `trans()` for labels and descriptions so localization works out of the box.

What is a Type?
---------------

[](#what-is-a-type)

A **type** in Typeify is a named key (e.g. `blog`, `product`, `page`) inside a single registry—your subclass of `BaseType`. Each type holds a set of **parameters**: label, description, and any flags or options you attach via traits.

- **Define** – Call `define('key')` to register a new type, then chain methods to set parameters.
- **Select** – Call `type('key')` to switch the current type and read or update its parameters.
- **Store** – All data is stored in the Laravel container under `typeName()`, so it is global and consistent for the request.

Consider a content system that needs post types (blog, news, page) and product types (physical, digital). With Typeify, you create a `PostType` and a `ProductType` registry, define each type with labels and descriptions, enable import/export or hierarchical where needed, and reuse the same definitions everywhere—in forms, tables, and API responses. The power lies not only in centralizing type config but in making it discoverable, translatable, and extensible through traits.

What Awaits You?
----------------

[](#what-awaits-you)

By adopting Typeify, you will:

- **Reduce development time** – Focus on domain types instead of config plumbing and duplicated arrays
- **Write cleaner, more maintainable code** – One registry per concern, fluent API, no scattered type checks
- **Scale your type system effortlessly** – Add traits and new types without breaking existing ones
- **Stay Laravel-native** – Service container, `trans()` for labels/descriptions, and familiar patterns throughout
- **Empower consistency** – Same type definitions everywhere: APIs, admin panels, and CLI

Quick Start
-----------

[](#quick-start)

Install Typeify via Composer:

```
composer require jobmetric/typeify
```

Usage (Examples)
----------------

[](#usage-examples)

Create a type registry by extending `BaseType` and implementing `typeName()`:

```
namespace App\Type;

use JobMetric\Typeify\BaseType;

class PostType extends BaseType
{
    protected function typeName(): string
    {
        return 'post-type';
    }
}
```

Define types and attach parameters (labels, descriptions, flags):

```
$postType = new PostType();

$postType->define('blog')
    ->label('Blog Post')
    ->description('Posts for the blog section')
    ->hierarchical()
    ->import()
    ->export();

$postType->define('news')
    ->label('News')
    ->description('News articles');
```

Select a type and read its data:

```
$postType->type('blog');

$label = $postType->getLabel();
$description = $postType->getDescription();
$allParams = $postType->get();

$postType->ensureTypeExists('blog');
$availableTypes = $postType->getTypes();
```

Documentation
-------------

[](#documentation)

Ready to centralize your type system? Our comprehensive documentation is your gateway to mastering Typeify:

**[📚 Read Full Documentation →](https://jobmetric.github.io/packages/typeify/)**

The documentation includes:

- **Getting Started** – Quick introduction and installation guide
- **BaseType** – Define, select, get/set parameters, container storage
- **Traits** – HasLabelType, HasDescriptionType, HasImportType, HasExportType, HasHierarchicalType, HasListOptionType, HasDriverNamespaceType
- **Exceptions** – TypeifyTypeNotFoundException, TypeifyTypeNotMatchException
- **Integration** – Using type registries in other packages and the Laravel ecosystem
- **Real-World Examples** – Post types, product types, and custom traits

Contributing
------------

[](#contributing)

Thank you for participating in `typeify`. A contribution guide can be found [here](CONTRIBUTING.md).

License
-------

[](#license)

The `typeify` is open-sourced software licensed under the MIT license. See [License File](LICENCE.md) for more information.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance75

Regular maintenance activity

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 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 ~103 days

Total

3

Last Release

137d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b00d08bd4b0b765ee2d33719a535e6cb49c04fb945078a0809d5c05e6f16ee96?d=identicon)[majidmohammadian](/maintainers/majidmohammadian)

---

Top Contributors

[![MajidMohammadian](https://avatars.githubusercontent.com/u/2099965?v=4)](https://github.com/MajidMohammadian "MajidMohammadian (23 commits)")

---

Tags

typelaravelpackagejobmetrictype-systemsystem type

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jobmetric-typeify/health.svg)

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

###  Alternatives

[creasi/laravel-nusa

A Laravel package that aim to provide Indonesia' Administrative Data

997.9k2](/packages/creasi-laravel-nusa)[pdazcom/laravel-referrals

A referrals system for a laravel projects.

291.5k](/packages/pdazcom-laravel-referrals)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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