PHPackages                             enmaboya/strictness-for-laravel - 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. enmaboya/strictness-for-laravel

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

enmaboya/strictness-for-laravel
===============================

more strictness for laravel

0.0.1(3mo ago)02↓90%MITPHP

Since Mar 30Pushed 3mo agoCompare

[ Source](https://github.com/enmaboya/strictness-for-laravel)[ Packagist](https://packagist.org/packages/enmaboya/strictness-for-laravel)[ RSS](/packages/enmaboya-strictness-for-laravel/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Strictness for Laravel
======================

[](#strictness-for-laravel)

A small Laravel package that adds **strict, validated accessors** for configuration values. It complements Laravel’s config layer - where values are usually defined in `config/*.php` and filled from **environment variables** - so mistakes surface as clear `InvalidArgumentException`s instead of subtle type or shape bugs later.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel `^11.0` or `^12.0`

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

[](#installation)

```
composer require enmaboya/strictness-for-laravel
```

Usage
-----

[](#usage)

Config keys work as usual; strict methods **read** those keys and enforce types and optional constraints.

**Strings** (`Enmaboya\StrictnessForLaravel\Enums\StringType`):

- `DEFAULT` - value must be a `string`
- `NON_EMPTY` - non-empty after `trim`
- `NON_FALSY` - non-empty string that is truthy in a PHP boolean sense
- `LOWERCASE` / `UPPERCASE` - exact case match

**Integers** (`Enmaboya\StrictnessForLaravel\Enums\IntType`):

- `DEFAULT` - value must be an `int`
- `POSITIVE` / `NEGATIVE` / `NON_ZERO` / `NON_NEGATIVE` / `NON_POSITIVE` - as named

```
use Enmaboya\StrictnessForLaravel\Enums\StringType;
use Enmaboya\StrictnessForLaravel\Enums\IntType;
use Enmaboya\StrictnessForLaravel\Facades\StrictConfig;

// Facade (same underlying `config` binding after extend)
$apiUrl = StrictConfig::string('services.api.url', type: StringType::NON_EMPTY);
$timeout = StrictConfig::integer('services.api.timeout', default: 30, type: IntType::NON_NEGATIVE);

// Helper (PHPDoc assumes StrictConfigRepository)
$region = strict_config()->string('app.region', type: StringType::LOWERCASE);
```

Values like `config('app.name')` populated from `env('APP_NAME')` are read through the same keys; the strict layer only cares that the **resolved** config value matches the expected type and constraint.

Feature checklist
-----------------

[](#feature-checklist)

- Strict `string()` reads with optional `StringType` validation
- Strict `integer()` reads with optional `IntType` validation
- Strict `validatedString()` reads with optional `IntType` validation
- Strict `validatedInteger()` reads with optional `IntType` validation
- Strict `env()`

License
-------

[](#license)

MIT

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance82

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity24

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

91d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/90896143?v=4)[Vitaliy Dubov](/maintainers/Enmaboya)[@enmaboya](https://github.com/enmaboya)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/enmaboya-strictness-for-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/enmaboya-strictness-for-laravel/health.svg)](https://phpackages.com/packages/enmaboya-strictness-for-laravel)
```

###  Alternatives

[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17818.7k](/packages/markwalet-nova-modal-response)[crumbls/layup

A visual page builder plugin for Filament 5 — Divi-style grid layouts with extensible widgets.

591.7k1](/packages/crumbls-layup)[tomshaw/electricgrid

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

119.2k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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