ixnode/php-checker
ixnode/php-checker is a lightweight PHP package offering reusable checker utilities for validating common data types and conditions. Its simple, focused methods help keep validation logic clean, readable, and consistent across Laravel and plain PHP projects.
Install with Composer:
composer require ixnode/php-checker
There is no Laravel service provider or config file to publish — this is a plain PHP validation/checker library. Start by reading vendor/ixnode/php-checker/README.md and the checker classes under vendor/ixnode/php-checker/src/. Look first at CheckerArray because 0.1.8 changes its public API.
First practical use case: guard array shape before processing request data. For example, ensure a payload is a sequential list before passing it to a batch job:
use Ixnode\PhpChecker\CheckerArray;
$checker = new CheckerArray();
$checker->checkSequential($payload); // throws on failure
In 0.1.8, the old checkSimple() and checkIndexArraySimple() methods were renamed to checkSequential() and checkIndexArraySequential(). If you are starting fresh, use the new names; if you are upgrading, update every call site.
Use the checker at the boundary where untyped data enters your domain — form requests, API controllers, queue jobs, or import services. A common Laravel pattern is to wrap the checker in a custom validation rule so failures become normal validation errors:
use Illuminate\Contracts\Validation\Rule;
use Ixnode\PhpChecker\CheckerArray;
class SequentialArrayRule implements Rule
{
public function passes($attribute, $value): bool
{
try {
(new CheckerArray())->checkSequential($value);
return true;
} catch (\Throwable $e) {
return false;
}
}
public function message(): string
{
return 'The :attribute must be a sequential array.';
}
}
For associative arrays with integer keys, use checkIndexArraySequential() after the rename. Keep checker usage close to the data source: validate in a form request, then pass already-checked arrays into services. Avoid scattering checker calls deep in your domain unless the data can originate from multiple untrusted sources.
Integration tips:
required, string, max, etc.).ValidationException in HTTP contexts so clients receive a 422 response instead of a 500.CheckerArray::checkSimple() is now checkSequential(), and checkIndexArraySimple() is now checkIndexArraySequential(). There are no compatibility aliases in the release notes, so search your codebase for the old method names before upgrading. Pin ixnode/php-checker to ^0.1.8 only after updating call sites.ValidationException.json_encode() or var_export() to confirm whether keys are sequential or associative.php-checker when you need explicit array-shape checks that are awkward to express with array rules.checkSimple and checkIndexArraySimple, update tests, and verify any custom rules that reference those methods.How can I help you explore Laravel packages today?