Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Assert Laravel Package

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.

View on GitHub
Deep Wiki
Context7

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.

  • Simple, expressive API: Assertion::file(), Assertion::digit(), and many more
  • Exception-driven failures remove manual conditional checks
  • Minimal dependencies and near-zero overhead
  • Installable via Composer: composer require beberlei/assert
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource