Download the PHP package abdulsalamalkhatib/laravel-guardian without Composer

On this page you can find all versions of the php package abdulsalamalkhatib/laravel-guardian. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-guardian

Laravel Guardian

Production correctness engine for Laravel.

Laravel Guardian looks for code that is syntactically valid, type-correct, and often testable, but can still violate production invariants under transactions, concurrency, or serialization.

V1 intentionally ships only three rules:

Guardian is not a replacement for PHPStan, Larastan, Telescope, Debugbar, or a generic SAST scanner. It focuses on Laravel-specific production semantics.

Requirements

Installation

After publishing the package to Packagist:

For local development from this ZIP before publishing:

Then:

Quick start

or without booting the Laravel application:

Example output:

GUA-001 — transaction side effects

Unsafe:

The remote system may commit while the DB transaction later rolls back.

Guardian also follows known application calls:

Safe queued pattern:

Built-in external-effect families include HTTP, mail, notifications, queue dispatch, filesystem writes, process execution, and configured external SDK methods.

GUA-002 — unsafe Eloquent read-modify-write

Unsafe lost update:

A database transaction by itself does not make this safe.

Safe pessimistic lock:

Safe fixed atomic delta:

Still unsafe despite using increment():

The write primitive is atomic, but the delta was derived from stale state. Guardian distinguishes this from a fixed atomic increment.

Guardian also detects check-then-act transitions such as:

Use row locks or compare-and-swap semantics for state transitions.

GUA-003 — sensitive exposure

Guardian builds a sensitivity registry from:

  1. explicit sensitive_fields configuration;
  2. Eloquent $hidden fields;
  3. a conservative built-in list for secrets such as passwords, API keys, refresh tokens, and 2FA secrets.

Unsafe:

If Player::$hidden or Guardian config marks phone as sensitive, the resource is reported.

Configured sanitizers are treated as declassification boundaries:

Guardian also tracks simple local-variable taint into response()->json(), JsonResponse, and resource arrays.

Configuration

Publish config/guardian.php and tune only application-specific policy:

Commands

Laravel aliases:

Exit codes:

Code Meaning
0 Scan succeeded and no blocking finding exists
1 Blocking finding exists
2 Invalid configuration / analysis setup
3 Guardian internal failure

Severity and confidence are separate

A finding can be:

or:

Severity answers how bad the failure would be. Confidence answers how strongly static analysis proved the path.

Baseline

Adopt Guardian on a legacy codebase without blocking every existing issue:

This writes stable semantic fingerprints to guardian-baseline.json. Subsequent scans still show counts for suppressed/baselined findings but only new active findings block CI.

Refresh the baseline by running the command again after fixing or intentionally accepting findings.

Narrow suppressions

Inline suppression requires a reason:

Method/class suppression:

For intentional sensitive exposure, prefer the narrower field-level attribute instead of suppressing all of GUA-003:

GuardianAllowsSensitive can be placed on a resource method or class and only suppresses the listed sensitive fields.

Avoid broad project-wide ignores. A suppression is an explicit correctness exception and should be reviewable.

PHPStan / Larastan integration

The package ships a PHPStan extension bridge in extension.neon.

With PHPStan extension discovery enabled, or by including it manually:

A full-directory PHPStan analysis receives Guardian findings as PHPStan errors with identifiers:

Guardian metadata includes severity, confidence, and fingerprint. File-only partial PHPStan runs intentionally do not trigger Guardian's whole-project scan.

CI

Console gate:

SARIF:

GitLab Code Quality:

JUnit:

Plugin SDK

Guardian's registry supports additional rules and domain adapters without modifying core:

Extension contracts:

Future plugin families can live under separate Composer packages such as Guardian\Concurrency, Guardian\Queues, and Guardian\Performance without bloating the V1 core rule set.

Architecture

See docs/ARCHITECTURE.md for the detailed design and correctness boundaries.

Known limits

Static analysis cannot prove all behavior in highly dynamic PHP. Guardian deliberately prefers an explicit confidence level over pretending certainty.

Current V1 limitations include:

Zero Guardian findings means no supported invariant violation was proven. It does not mean the application is bug-free.

Development

The integration suite contains both unsafe fixtures that must be detected and safe fixtures that must remain clean.

License

MIT.


All versions of laravel-guardian with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
nikic/php-parser Version ^5.4
phpstan/phpstan Version ^2.2.2
larastan/larastan Version ^3.11
illuminate/console Version ^11.44.2 || ^12.4.1 || ^13.0
illuminate/contracts Version ^11.44.2 || ^12.4.1 || ^13.0
illuminate/support Version ^11.44.2 || ^12.4.1 || ^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package abdulsalamalkhatib/laravel-guardian contains the following files

Loading the files please wait ...