PHPackages                             benjamimwalker/command-validator - 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. [CLI &amp; Console](/categories/cli)
4. /
5. benjamimwalker/command-validator

ActiveLibrary[CLI &amp; Console](/categories/cli)

benjamimwalker/command-validator
================================

A package to validate arguments and options on laravel commands.

v1.0(11mo ago)01MITPHPPHP ^8.2CI passing

Since Jun 13Pushed 11mo agoCompare

[ Source](https://github.com/benjamimWalker/command-validator)[ Packagist](https://packagist.org/packages/benjamimwalker/command-validator)[ RSS](/packages/benjamimwalker-command-validator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

Command Validator
=================

[](#command-validator)

> A lightweight Laravel package to validate command arguments and options using Laravel's validation.

**Command Validator** enables automatic validation of Laravel command inputs using a simple attribute. Define rules on your command class, and invalid input will be handled gracefully; including proper error messages and test-safe exceptions.

---

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

[](#installation)

Install the package via Composer:

```
composer require benjamimwalker/command-validator
```

---

Usage
-----

[](#usage)

Apply the `Validatable` attribute to any Artisan command class to define validation rules for arguments and options.

### Example

[](#example)

```
use CommandValidator\Attributes\Validatable;
use Illuminate\Console\Command;

#[Validatable([
    'name' => ['required', 'string', 'min:3'],
    'email' => ['required', 'email'],
    'steps' => ['string'],
])]
class Dummy extends Command
{
    protected $signature = 'u:c
        {--name= : The name of the user}
        {--email= : The email of the user}
        {steps}';

    protected $description = 'Command description';

    public function handle()
    {
        // Safe to use validated inputs here
    }
}
```

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](https://github.com/benjamimWalker/command-validator/blob/master/LICENSE.md).

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance52

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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

Unknown

Total

1

Last Release

340d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/59a7ba395804b011383fbcdff7c82d5fe029e3e3bb660a636df12dbaf2b0d2ce?d=identicon)[benjamim](/maintainers/benjamim)

---

Top Contributors

[![benjamimWalker](https://avatars.githubusercontent.com/u/55597702?v=4)](https://github.com/benjamimWalker "benjamimWalker (18 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/benjamimwalker-command-validator/health.svg)

```
[![Health](https://phpackages.com/badges/benjamimwalker-command-validator/health.svg)](https://phpackages.com/packages/benjamimwalker-command-validator)
```

###  Alternatives

[acdphp/laravel-schedule-police

Stop, start or execute scheduled commands from a simple dashboard without redeploying, while maintaining the visibility, control, and reviewability of the configurations in your codebase.

5116.9k](/packages/acdphp-laravel-schedule-police)[jakyeru/laravel-shell

Laravel-Shell adds a terminal interface to your web application, allowing you to run shell commands directly from your browser.

166.1k](/packages/jakyeru-laravel-shell)

PHPackages © 2026

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