PHPackages                             smpita/typeas - 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. smpita/typeas

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

smpita/typeas
=============

Guaranteed type control for PHP

v4.2.0(3mo ago)243.0k↓22.6%1[1 PRs](https://github.com/smpita/typeas/pulls)1MITPHPPHP ^8.1CI passing

Since Sep 30Pushed 1mo ago1 watchersCompare

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

READMEChangelog (10)Dependencies (4)Versions (25)Used By (1)

Guaranteed type control for PHP
===============================

[](#guaranteed-type-control-for-php)

Easily type your `mixed` signatures. Perfect for static analysis!

[![Total Downloads](https://camo.githubusercontent.com/d4b6f3fb90f6488212e63fd4f0b7879a11161524d6f3dc502937bb8ffd1a15e3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736d706974612f7479706561732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/smpita/typeas)[![Latest Version on Packagist](https://camo.githubusercontent.com/35f1f345411218f6cbbcd467926da6f9933e704d81a7ffdb17825e53672846c4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736d706974612f7479706561732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/smpita/typeas)[![License](https://camo.githubusercontent.com/3317597000f1f296334a7fc43b79603bfae77fb0ef24d06705ea33c1371af500/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f736d706974612f7479706561732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/smpita/typeas)

[![GitHub Tests Action Status](https://camo.githubusercontent.com/f67720e2e2861ecd600ad73a4e7d7efd0c0035e8f13c471261cea5a6057508dc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736d706974612f7479706561732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/smpita/typeas/actions?query=workflow%3Arun-tests+branch%3Amain)[![Coverage Status](https://camo.githubusercontent.com/86f41138698df5a8cdbed7d965449c9c0528c296c106779e8285bb130fad1eeb/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f736d706974612f7479706561732f62616467652e737667)](https://coveralls.io/github/smpita/typeas)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/fcafce690de12d378e6e679df84d50ef3d28302a572f1d1b70976e0b773fbbc2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736d706974612f7479706561732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/smpita/typeas/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)

[![FOSSA Status](https://camo.githubusercontent.com/f6a63cc96e7ef2f63a8371f2bc7fb7ecd1b1d8acd9eea419aae7332eeffebfa7/68747470733a2f2f6170702e666f7373612e636f6d2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246736d706974612532467479706561732e7376673f747970653d736869656c64266973737565547970653d7365637572697479)](https://app.fossa.com/projects/git%2Bgithub.com%2Fsmpita%2Ftypeas?ref=badge_shield&issueType=security)[![FOSSA Status](https://camo.githubusercontent.com/69a48df4cdafb0e910e2a7d29544191bbe6f1c9163eff18e96a39ab5fc7a8b84/68747470733a2f2f6170702e666f7373612e636f6d2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246736d706974612532467479706561732e7376673f747970653d736869656c64266973737565547970653d6c6963656e7365)](https://app.fossa.com/projects/git%2Bgithub.com%2Fsmpita%2Ftypeas?ref=badge_shield&issueType=license)

---

Table of Contents
-----------------

[](#table-of-contents)

- [Quick Start](#quick-start)
    - [Installation](#installation)
    - [Resolving Types](#resolving-types)
    - [Fluent Syntax](#fluent-syntax)
    - [Array Wrapping](#array-wrapping)
    - [Official Extensions](#official-extensions)
    - [Custom Resolvers](#custom-resolvers)
    - [Helpers](#helpers)
- [Upgrade Guide](docs/upgrading.md)
- [Deprecations](#deprecations)
- [Testing](#testing)
- [Changelog](#changelog)
- [Contributing](#contributing)
- [Security Vulnerabilities](#security-vulnerabilities)
- [Credits](#credits)
- [License](#license)

---

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

[](#quick-start)

### Installation

[](#installation)

Install the package via composer:

```
composer require smpita/typeas
```

See [SIGNATURES](docs/signatures.md) for the full list of methods and signatures.

### Resolving types

[](#resolving-types)

[SIGNATURES#resolving](docs/signatures.md#resolving)

Pass a mixed variable to get a typed variable.

```
use Smpita\TypeAs\TypeAs;

// Throws \Smpita\TypeAs\TypeAsResolutionException if $mixed can't resolve to the type.
$array = TypeAs::array($mixed);
$bool = TypeAs::bool($mixed);
$class = TypeAs::class(Expected::class, $mixed);
$float = TypeAs::float($mixed);
$int = TypeAs::int($mixed);
$string = TypeAs::string($mixed);

// Returns null if $mixed can't resolve to the type.
$nullableArray = TypeAs::nullableArray($mixed);
$nullableBool = TypeAs::nullableBool($mixed);
$nullableClass = TypeAs::nullableClass(Expected::class, $mixed);
$nullableFloat = TypeAs::nullableFloat($mixed);
$nullableInt = TypeAs::nullableInt($mixed);
$nullableString = TypeAs::nullableString($mixed);
```

### Defaults

[](#defaults)

To suppress throwing exceptions, provide a default.

```
use Smpita\TypeAs\TypeAs;

// Returns the default if passed null, or if $mixed can't resolve to the type.
$array = TypeAs::array($mixed, []);
$bool = TypeAs::bool($mixed, false);
$class = TypeAs::class(Expected::class, $mixed, new StdClass());
$float = TypeAs::float($mixed, 0.0);
$int = TypeAs::int($mixed, 0);
$string = TypeAs::string($mixed, '');

// Nullable types can specify defaults.
$nullableArray = TypeAs::nullableArray($mixed, []);
$nullableBool = TypeAs::nullableBool($mixed, false);
$nullableClass = TypeAs::nullableClass(Expected::class, $mixed, new StdClass());
$nullableFloat = TypeAs::nullableFloat($mixed, 0.0);
$nullableInt = TypeAs::nullableInt($mixed, 0);
$nullableString = TypeAs::nullableString($mixed, '');

// As a named parameter
$array = TypeAs::array(value: $mixed, default: []);
```

### Array Wrapping

[](#array-wrapping)

[SIGNATURES#array](docs/signatures.md#array)

By default, `array()` will wrap non-iterables similar to `(array) $mixed` instead of throwing exceptions.

```
use Smpita\TypeAs\TypeAs;

TypeAs::array('example'); // returns ['example']
TypeAs::array(['example']); // returns ['example']

/**
 * Disable array wrapping to get exceptions.
 * These throw \Smpita\TypeAs\TypeAsResolutionException
 */
TypeAs::array('example', wrap: false);
TypeAs::array('example', null, null, false);
```

---

Fluent Syntax
-------------

[](#fluent-syntax)

As a convenience, TypeAs supports fluent syntax. The `NonNullable` and `Nullable` fluent classes wrap the base TypeAs methods. In performance critical environments, the [standard methods](#resolving-types) are recommended.

### Basic Usage

[](#basic-usage)

```
use Smpita\TypeAs\TypeAs;

$array = TypeAs::type($mixed)->asArray();
$bool = TypeAs::type($mixed)->asBool();
$filterBool = TypeAs::type($mixed)->asFilterBool()
$class = TypeAs::type($mixed)->asClass(Expected::class);
$float = TypeAs::type($mixed)->asFloat();
$int = TypeAs::type($mixed)->asInt();
$string = TypeAs::type($mixed)->asString();
```

### Nullable

[](#nullable)

Chain `nullable()` for nullable returns.

Note: Moving between `NonNullable` and `Nullable` returns a new instance of the associated class.

```
use Smpita\TypeAs\TypeAs;

$nullableArray = TypeAs::type($mixed)
    ->nullable()
    ->asArray();
```

```
use Smpita\TypeAs\TypeAs;

$array = $typeAsNullableInstance
    ->nonNullable()
    ->asArray();
```

### Custom Resolver

[](#custom-resolver)

Chain `using()` to resolve using a [Custom Resolver](#custom-resolvers).

```
use Smpita\TypeAs\TypeAs;

$array = TypeAs::type($mixed)
    ->using(new CustomArrayResolver())
    ->asArray();
```

### Defaults

[](#defaults-1)

Chain `default()` to specify a default.

```
use Smpita\TypeAs\TypeAs;

$array = TypeAs::type($mixed)
    ->default([])
    ->asArray();
```

### Wrapping

[](#wrapping)

```
TypeAs::type('')->noWrap()->asArray();
TypeAs::type('')->wrap(false)->asArray();
```

### Copying

[](#copying)

```
use Smpita\TypeAs\TypeAs;

$instance = TypeAs::type($mixed);

$assignment = $instance; // $assignment mutates when $instance changes.
$copy = $instance->copy(); // $copy is unaffected by changes to $instance.
$clone = clone $instance; // $clone is unaffected by changes to $instance.
```

### Accessing the config

[](#accessing-the-config)

```
use Smpita\TypeAs\Fluent\Nullable;
use Smpita\TypeAs\Fluent\NonNullable;

// Returns \Smpita\TypeAs\Fluent\TypeConfig
$config = NonNullable::make()->config();
$config = Nullable::make()->config();
```

### Importing a config

[](#importing-a-config)

```
use Smpita\TypeAs\Fluent\Nullable;
use Smpita\TypeAs\Fluent\NonNullable;
use Smpita\TypeAs\Fluent\TypeConfig;

$config = new TypeConfig(
    fromValue: $mixed,
    defaultTo: $default,
    resolveUsing: $resolver,
    arrayWrap: null,
);

$nonNullable = NonNullable::make($config);
$nonNullable = (new NonNullable())->import($config);

$nullable = Nullable::make($config);
$nullable = (new Nullable())->import($config);
```

---

Extensions
----------

[](#extensions)

Extensions are created by passing a custom resolver to a function.

### Official Extensions

[](#official-extensions)

```
 /**
  * @see \Smpita\TypeAs\Resolvers\Extensions\AsNullableFilterBool
  *
  * Uses FILTER_VALIDATE_BOOL
  * https://www.php.net/manual/en/filter.constants.php#constant.filter-validate-bool
  *
  * Returns true  on 1 1.0 "1" "true"  "yes" "on"
  * Returns false on 0 0.0 "0" "false" "no" "off" ""
  */

$filterBool = TypeAs::filterBool($mixed, $default);
$nullableFilterBool = TypeAs::nullableFilterBool($mixed, $default);
```

### Custom Resolvers

[](#custom-resolvers)

[SIGNATURES#resolver-registration](docs/signatures.md#resolver-registration)

Each base type has an associated interface located in `Smpita\TypeAs\Contracts` which you can implement to make your own resolvers.

Simply implement the interface, then either register the resolver or use it in the resolver method.

### Interfaces

[](#interfaces)

- `Smpita\TypeAs\Contracts\ArrayResolver`
- `Smpita\TypeAs\Contracts\BoolResolver`
- `Smpita\TypeAs\Contracts\ClassResolver`
- `Smpita\TypeAs\Contracts\FloatResolver`
- `Smpita\TypeAs\Contracts\IntResolver`
- `Smpita\TypeAs\Contracts\StringResolver`
- `Smpita\TypeAs\Contracts\NullableArrayResolver`
- `Smpita\TypeAs\Contracts\NullableClassResolver`
- `Smpita\TypeAs\Contracts\NullableFloatResolver`
- `Smpita\TypeAs\Contracts\NullableIntResolver`
- `Smpita\TypeAs\Contracts\NullableStringResolver`

### Creating Custom Resolvers

[](#creating-custom-resolvers)

```
use Smpita\TypeAs\Contracts\StringResolver;

class CustomStringResolver implements StringResolver
{
    /**
     * @throws \Smpita\TypeAs\Exceptions\TypeAsResolutionException
     */
    public function resolve(mixed $value, string $default = null): string
    {
        /**
         * Your logic here
         *
         * Note:
         * The resolver is responsible for returning $default when appropriate.
         * See \Smpita\TypeAs\Resolvers for examples.
         */
    }
}
```

### Registering Custom Resolvers

[](#registering-custom-resolvers)

#### Globally

[](#globally)

To globally register a resolver, use the associated setter method. In Laravel, it's recommended to do this in the boot method of a `ServiceProvider`.

```
use Smpita\TypeAs\TypeAs;

TypeAs::setArrayResolver(new CustomArrayResolver());
TypeAs::setBoolResolver(new CustomBoolResolver());
TypeAs::setClassResolver(new CustomClassResolver());
TypeAs::setFloatResolver(new CustomFloatResolver());
TypeAs::setIntResolver(new CustomIntResolver());
TypeAs::setStringResolver(new CustomStringResolver());
TypeAs::setNullableArrayResolver(new CustomNullableArrayResolver());
TypeAs::setNullableBoolResolver(new CustomNullableBoolResolver());
TypeAs::setNullableClassResolver(new CustomNullableClassResolver());
TypeAs::setNullableFloatResolver(new CustomNullableFloatResolver());
TypeAs::setNullableIntResolver(new CustomIntNullableResolver());
TypeAs::setNullableStringResolver(new CustomNullableStringResolver());
```

### Unregistering Custom Resolvers

[](#unregistering-custom-resolvers)

To return to default, set the resolver to `null`.

```
use Smpita\TypeAs\TypeAs;

TypeAs::setArrayResolver(null);
TypeAs::setBoolResolver(null);
TypeAs::setClassResolver(null);
TypeAs::setFloatResolver(null);
TypeAs::setIntResolver(null);
TypeAs::setStringResolver(null);
TypeAs::setNullableArrayResolver(null);
TypeAs::setNullableBoolResolver(null);
TypeAs::setNullableClassResolver(null);
TypeAs::setNullableFloatResolver(null);
TypeAs::setNullableIntResolver(null);
TypeAs::setNullableStringResolver(null);

// Return all resolvers to default
TypeAs::useDefaultResolvers();
```

#### Single use

[](#single-use)

Inject a resolver to use it on a per call basis.

```
use Smpita\TypeAs\TypeAs;

$array = TypeAs::array($mixed, resolver: new CustomArrayResolver());
$bool = TypeAs::bool($mixed, resolver: new CustomBoolResolver());
$class = TypeAs::class(Expected::class, $mixed, resolver: new CustomClassResolver());
$float = TypeAs::float($mixed, resolver: new CustomFloatResolver());
$int = TypeAs::int($mixed, resolver: new CustomIntResolver());
$string = TypeAs::string($mixed, resolver: new CustomStringResolver());
$nullableArray = TypeAs::nullableArray($mixed, resolver: new CustomNullableArrayResolver());
$nullableBool = TypeAs::nullableBool($mixed, resolver: new CustomNullableBoolResolver());
$nullableClass = TypeAs::nullableClass(Expected::class, $mixed, resolver: new CustomNullableClassResolver());
$nullableFloat = TypeAs::nullableFloat($mixed, resolver: new CustomNullableFloatResolver());
$nullableInt = TypeAs::nullableInt($mixed, resolver: new CustomNullableIntResolver());
$nullableString = TypeAs::nullableString($mixed, resolver: new CustomNullableStringResolver());

// or

$array = TypeAs::array($mixed, null, new CustomArrayResolver());
$bool = TypeAs::bool($mixed, null, new CustomBoolResolver());
$class = TypeAs::class(Expected::class, $mixed, null, new CustomClassResolver());
$float = TypeAs::float($mixed, null, new CustomFloatResolver());
$int = TypeAs::int($mixed, null, new CustomIntResolver());
$string = TypeAs::string($mixed, null, new CustomStringResolver());
$nullableArray = TypeAs::nullableArray($mixed, null, new CustomNullableArrayResolver());
$nullableBool = TypeAs::nullableBool($mixed, null, new CustomNullableBoolResolver());
$nullableClass = TypeAs::nullableClass(Expected::class, $mixed, null, new CustomNullableClassResolver());
$nullableFloat = TypeAs::nullableFloat($mixed, null, new CustomNullableFloatResolver());
$nullableInt = TypeAs::nullableInt($mixed, null, new CustomNullableIntResolver());
$nullableStTypeAs::nullableString($mixed, null, new CustomNullableStringResolver());
```

If you registered a custom resolver then want to use a default resolver on a per call basis, you must pass a default resolver.

```
use Smpita\TypeAs\TypeAs;

$array = TypeAs::array($mixed, resolver: new \Smpita\TypeAs\Resolvers\AsArray());
$bool = TypeAs::bool($mixed, resolver: new \Smpita\TypeAs\Resolvers\AsBool());
$class = TypeAs::class(Expected::class, $mixed, resolver: \Smpita\TypeAs\Resolvers\AsClass());
$float = TypeAs::float($mixed, resolver: new \Smpita\TypeAs\Resolvers\AsFloat());
$int = TypeAs::int($mixed, resolver: new \Smpita\TypeAs\Resolvers\AsInt());
$string = TypeAs::string($mixed, resolver: new \Smpita\TypeAs\Resolvers\AsString());
$nullableArray = TypeAs::nullableArray($mixed, resolver: new \Smpita\TypeAs\Resolvers\AsNullableArray());
$nullableBool = TypeAs::nullableBool($mixed, resolver: new \Smpita\TypeAs\Resolvers\AsNullableBool());
$nullableClass = TypeAs::nullableClass(Expected::class, $mixed, resolver: new \Smpita\TypeAs\Resolvers\AsNullableClass());
$nullableFloat = TypeAs::nullableFloat($mixed, resolver: new \Smpita\TypeAs\Resolvers\AsNullableFloat());
$nullableInt = TypeAs::nullableInt($mixed, resolver: new \Smpita\TypeAs\Resolvers\AsNullableInt());
$nullableString = TypeAs::nullableString($mixed, resolver: new \Smpita\TypeAs\Resolvers\AsNullableString());

// or

$array = TypeAs::array($mixed, null, new \Smpita\TypeAs\Resolvers\AsArray());
$bool = TypeAs::bool($mixed, null, new \Smpita\TypeAs\Resolvers\AsBool());
$class = TypeAs::class(Expected::class, $mixed, null, \Smpita\TypeAs\Resolvers\AsClass());
$float = TypeAs::float($mixed, null, new \Smpita\TypeAs\Resolvers\AsFloat());
$int = TypeAs::int($mixed, null, new \Smpita\TypeAs\Resolvers\AsInt());
$string = TypeAs::string($mixed, null, new \Smpita\TypeAs\Resolvers\AsString());
$nullableArray = TypeAs::nullableArray($mixed, null, new \Smpita\TypeAs\Resolvers\AsNullableArray());
$nullableBool = TypeAs::nullableBool($mixed, null, new \Smpita\TypeAs\Resolvers\AsNullableBool());
$nullableClass = TypeAs::nullableClass(Expected::class, $mixed, null, new \Smpita\TypeAs\Resolvers\AsNullableClass());
$nullableFloat = TypeAs::nullableFloat($mixed, null, new \Smpita\TypeAs\Resolvers\AsNullableFloat());
$nullableInt = TypeAs::nullableInt($mixed, null, new \Smpita\TypeAs\Resolvers\AsNullableInt());
$nullableString = TypeAs::nullableString($mixed, null, new \Smpita\TypeAs\Resolvers\AsNullableString());
```

---

Helpers
-------

[](#helpers)

[SIGNATURES#helpers](docs/signatures.md#helpers)

### Global

[](#global)

```
// Standard Helpers
$array = asArray($mixed);
$bool = asBool($mixed);
$filterBool = asFilterBool($mixed);
$class = asClass(Target::class, $mixed);
$float = asFloat($mixed);
$int = asInt($mixed);
$string = asString($mixed);
$nullableArray = asNullableArray($mixed);
$nullableBool = asNullableBool($mixed);
$nullableFilterBool = asNullableFilterBool($mixed);
$nullableClass = asNullableClass(Target::class, $mixed);
$nullableFloat = asNullableFloat($mixed);
$nullableInt = asNullableInt($mixed);
$nullableString = asNullableString($mixed);

// Fluent Helpers
$type = type($mixed);
```

### Local

[](#local)

Each global helper has a local counterpart you can import if the global helper collides with another global method.

```
use function Smpita\TypeAs\asArray as TypeAsArray;
use function Smpita\TypeAs\asBool as TypeAsBool;
use function Smpita\TypeAs\asFilterBool as TypeAsFilterBool;
use function Smpita\TypeAs\asClass as TypeAsClass;
use function Smpita\TypeAs\asFloat as TypeAsFloat
use function Smpita\TypeAs\asInt as TypeAsInt;
use function Smpita\TypeAs\asString as TypeAsString;
use function Smpita\TypeAs\asNullableArray as TypeAsNullableArray;
use function Smpita\TypeAs\asNullableBool as TypeAsNullableBool;
use function Smpita\TypeAs\asNullableFilterBool as TypeAsNullableFilterBool;
use function Smpita\TypeAs\asNullableClass as TypeAsNullableClass;
use function Smpita\TypeAs\asNullableFloat as TypeAsNullableFloat;
use function Smpita\TypeAs\asNullableInt as TypeAsNullableInt;
use function Smpita\TypeAs\asNullableString as TypeAsNullableString;
use function Smpita\TypeAs\type as TypeAsType;
```

---

Deprecations
------------

[](#deprecations)

Please see the [Upgrade Guide](docs/upgrading.md) and [SIGNATURES#deprecations](docs/signatures.md#deprecations) if you encounter a breaking change.

---

Testing
-------

[](#testing)

```
composer test
```

---

Changelog
---------

[](#changelog)

Please see [RELEASES](https://github.com/smpita/typeas/releases) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Sean Pearce](https://github.com/smpita)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

[![FOSSA Status](https://camo.githubusercontent.com/afeb85bf57fcc54980036464dea0060fdd8fbafdc64193d725eebdced99f2fa0/68747470733a2f2f6170702e666f7373612e636f6d2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246736d706974612532467479706561732e7376673f747970653d6c61726765)](https://app.fossa.com/projects/git%2Bgithub.com%2Fsmpita%2Ftypeas?ref=badge_large)

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance84

Actively maintained with recent releases

Popularity34

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 93.8% 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 ~36 days

Recently: every ~6 days

Total

24

Last Release

118d ago

Major Versions

v1.0.1 → v2.0.02023-09-30

v2.5.0 → v3.0.02023-10-27

v3.2.2 → v4.0.02025-11-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/82da7b23480d977f3d1715a262aa994457f4ebb577923c8cc2bf7cb598168b34?d=identicon)[smpita](/maintainers/smpita)

---

Top Contributors

[![smpita](https://avatars.githubusercontent.com/u/14220530?v=4)](https://github.com/smpita "smpita (302 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (19 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelsmpitatypeas

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/smpita-typeas/health.svg)

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

###  Alternatives

[highideas/laravel-users-online

This package will provide an online users management.

203113.2k1](/packages/highideas-laravel-users-online)[stephenjude/filament-blog

Filament Blog Builder

20317.8k](/packages/stephenjude-filament-blog)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[datomatic/nova-detached-actions

A Laravel Nova tool to allow for placing actions in the Nova toolbar detached from the checkbox selection mechanism.

11229.2k](/packages/datomatic-nova-detached-actions)

PHPackages © 2026

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