beberlei/assert
A simple PHP library of assertions and guard methods for fast, low-level input validation in business models, libraries, and application code. Failed assertions throw exceptions, eliminating if-clauses. Install via Composer: composer require beberlei/assert.
beberlei/assert is a lightweight PHP library that provides assertions and guard methods for input validation (not filtering) in business models, libraries, and low-level application code. It implements pre- and post-conditions on input data, throwing an exception whenever an assertion fails—eliminating boilerplate if-clauses and simplifying your code paths.
Unlike Symfony or Zend validators, the checks are deliberately low-level, fast, and non-object-oriented, requiring no object instantiation, locale component, or translations.
Assertion::file(), Assertion::digit(), and many morecomposer require beberlei/assertHow can I help you explore Laravel packages today?