PHPackages                             worksome/phpstan-request-factories - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. worksome/phpstan-request-factories

ActiveLibrary[Testing &amp; Quality](/categories/testing)

worksome/phpstan-request-factories
==================================

A PHPStan rule for enforcing that every request has a corresponding factory.

v2.2.0(4mo ago)1228.4k↑30.9%1[2 PRs](https://github.com/worksome/phpstan-request-factories/pulls)MITPHPPHP ^8.4CI passing

Since Jun 26Pushed 2mo ago9 watchersCompare

[ Source](https://github.com/worksome/phpstan-request-factories)[ Packagist](https://packagist.org/packages/worksome/phpstan-request-factories)[ Docs](https://github.com/worksome/phpstan-request-factories)[ GitHub Sponsors](https://github.com/worksome)[ RSS](/packages/worksome-phpstan-request-factories/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (4)Dependencies (18)Versions (10)Used By (0)

PHPStan Request Factories
=========================

[](#phpstan-request-factories)

[![Latest Version on Packagist](https://camo.githubusercontent.com/28cd4fb7fa9e66a65ca9e13a3c675ce85ad8d4b4ee9d78d079f3fd6fe1c4312b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f776f726b736f6d652f7068707374616e2d726571756573742d666163746f726965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/worksome/phpstan-request-factories)[![GitHub Tests Action Status](https://camo.githubusercontent.com/6099bd227d08fdd8c51bff3cdd238b699de6073ae5a28d3acd83ec8d8578a145/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f776f726b736f6d652f7068707374616e2d726571756573742d666163746f726965732f74657374732e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265266c6162656c3d5465737473)](https://github.com/worksome/phpstan-request-factories/actions?query=workflow%3ATests+branch%3Amain)[![GitHub Static Analysis Action Status](https://camo.githubusercontent.com/0e4d724b713d46cced354bf63057801aa9a700cb0b4698b96ce342e9deaf6d29/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f776f726b736f6d652f7068707374616e2d726571756573742d666163746f726965732f7374617469632e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265266c6162656c3d537461746963253230416e616c79736973)](https://github.com/worksome/phpstan-request-factories/actions?query=workflow%3A%22Static%20Analysis%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/7bce686caec81c18bcbc397d79547890f1a64fe16ae9c833e5a340a6e3d4b177/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f776f726b736f6d652f7068707374616e2d726571756573742d666163746f726965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/worksome/phpstan-request-factories)

A PHPStan rule for enforcing that every request has a corresponding factory.

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

[](#installation)

You can install the package via composer:

```
composer require --dev worksome/phpstan-request-factories
```

If you have also installed [`phpstan/extension-installer`](https://github.com/phpstan/extension-installer) then everything will work out of the box.

 Manual installationIf you don't want to use `phpstan/extension-installer`, include `extension.neon` in your project's PHPStan config:

```
includes:
    - vendor/worksome/phpstan-request-factories/extension.neon

```

Usage
-----

[](#usage)

### Choosing different namespaces

[](#choosing-different-namespaces)

The request and factory namespaces are both configurable. They can be configured using the following parameters:

- `requestFactories.requestsNamespace` (default is `App\\Http\\Requests`)
- `requestFactories.factoriesNamespace` (default is `Tests\\RequestFactories`)

For example:

```
parameters:
  requestFactories:
    requestsNamespace: App\Http\Requests
    factoriesNamespace: Tests\RequestFactories
```

### Excluding request classes

[](#excluding-request-classes)

If there are certain request classes that you want to exclude, you can exclude these using the `excludedRequestClasses` parameter.

For example:

```
parameters:
  requestFactories:
    excludedRequestClasses:
        - App\Http\Requests\IgnorableRequest
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [GitHub Releases](https://github.com/worksome/phpstan-request-factories/releases) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Owen Voke](https://github.com/owenvoke)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

54

—

FairBetter than 96% of packages

Maintenance81

Actively maintained with recent releases

Popularity37

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 77.8% 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

Every ~196 days

Recently: every ~245 days

Total

6

Last Release

121d ago

Major Versions

v1.1.0 → v2.0.02024-12-12

PHP version history (2 changes)v1.0.0PHP ^8.2

v2.2.0PHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1899334?v=4)[Owen Voke](/maintainers/owenvoke)[@owenvoke](https://github.com/owenvoke)

---

Top Contributors

[![owenvoke](https://avatars.githubusercontent.com/u/1899334?v=4)](https://github.com/owenvoke "owenvoke (14 commits)")[![odinns](https://avatars.githubusercontent.com/u/10807424?v=4)](https://github.com/odinns "odinns (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (1 commits)")

---

Tags

laravelworksomephpstan-request-factories

###  Code Quality

TestsPest

Static AnalysisPHPStan

### Embed Badge

![Health badge](/badges/worksome-phpstan-request-factories/health.svg)

```
[![Health](https://phpackages.com/badges/worksome-phpstan-request-factories/health.svg)](https://phpackages.com/packages/worksome-phpstan-request-factories)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M8.4k](/packages/larastan-larastan)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k108.5M885](/packages/laravel-socialite)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M150](/packages/laravel-mcp)[calebdw/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

15118.7k4](/packages/calebdw-larastan)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.3k3](/packages/defstudio-telegraph)

PHPackages © 2026

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