PHPackages                             marick/laravel-strict - 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. marick/laravel-strict

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

marick/laravel-strict
=====================

10PHP

Since Apr 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/marickvantuil/strict-helpers-for-laravel)[ Packagist](https://packagist.org/packages/marick/laravel-strict)[ RSS](/packages/marick-laravel-strict/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Use Laravel's helpers with strict type checking
===============================================

[](#use-laravels-helpers-with-strict-type-checking)

Laravel offers some handy helpers out-of-the-box. But their return types can make it difficult to combine it with static code analysis like PHPStan:

```
echo strlen(config('app.name'));
```

> Parameter #1 $string of function strlen expects string, mixed given

This happens because the helper can theoretically return any type:

```
/**
 * Get / set the specified configuration value.
 *
 * If an array is passed as the key, we will assume you want to set an array of values.
 *
 * @param  array|string|null  $key
 * @param  mixed  $default
 * @return mixed|\Illuminate\Config\Repository
 */
function config($key = null, $default = null)
```

This package wraps Laravel's helpers and adds nice methods that always expect a clear return type. If the method has a different return type, an exception will automatically be thrown, making it strict.

```
use function Marick\LaravelStrict\config;

echo strlen(config('app.name')->string());
```

Or use the global helper:

```
echo strlen(strictConfig('app.name'));

# Or in class form...
Helper::config('app.name')->string();
```

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![marickvantuil](https://avatars.githubusercontent.com/u/647007?v=4)](https://github.com/marickvantuil "marickvantuil (2 commits)")

### Embed Badge

![Health badge](/badges/marick-laravel-strict/health.svg)

```
[![Health](https://phpackages.com/badges/marick-laravel-strict/health.svg)](https://phpackages.com/packages/marick-laravel-strict)
```

PHPackages © 2026

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