PHPackages                             michael-rubel/laravel-safe-request - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. michael-rubel/laravel-safe-request

AbandonedArchivedLibrary[Validation &amp; Sanitization](/categories/validation)

michael-rubel/laravel-safe-request
==================================

Makes your FormRequest keys retrieved from `$request-&gt;safe()` method by default to prevent retrieval of unvalidated input values.

2.0.1(3y ago)1312.3kMITPHPPHP ^8.0

Since Jun 2Pushed 3y ago1 watchersCompare

[ Source](https://github.com/michael-rubel/laravel-safe-request)[ Packagist](https://packagist.org/packages/michael-rubel/laravel-safe-request)[ Docs](https://github.com/michael-rubel/laravel-safe-request)[ Fund](https://paypal.me/observername)[ RSS](/packages/michael-rubel-laravel-safe-request/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (9)Versions (10)Used By (0)

[![Safe input by default](https://user-images.githubusercontent.com/37669560/176688983-0dacba26-c133-45ba-aa9d-f6c695fd903c.png)](https://user-images.githubusercontent.com/37669560/176688983-0dacba26-c133-45ba-aa9d-f6c695fd903c.png)

Laravel Safe Request
====================

[](#laravel-safe-request)

[![Latest Version on Packagist](https://camo.githubusercontent.com/44a8717afefe8b23a8414d25fdf90e401ad438c157a920fb63482d4638a1d0b9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d69636861656c2d727562656c2f6c61726176656c2d736166652d726571756573742e7376673f7374796c653d666c61742d737175617265266c6f676f3d7061636b6167697374)](https://packagist.org/packages/michael-rubel/laravel-safe-request)[![Total Downloads](https://camo.githubusercontent.com/355f5e6318b3096e3c107245cf8b0acd59e47c13549156dbfb5d6346f72f4ee4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d69636861656c2d727562656c2f6c61726176656c2d736166652d726571756573742e7376673f7374796c653d666c61742d737175617265266c6f676f3d7061636b6167697374)](https://packagist.org/packages/michael-rubel/laravel-safe-request)[![Code Quality](https://camo.githubusercontent.com/f00bd4ea8c2e8a0b757436eab13a02b9a6200d07c9e84b326537182d77dd78c5/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f7175616c6974792f672f6d69636861656c2d727562656c2f6c61726176656c2d736166652d726571756573742e7376673f7374796c653d666c61742d737175617265266c6f676f3d7363727574696e697a6572)](https://scrutinizer-ci.com/g/michael-rubel/laravel-safe-request/?branch=main)[![Code Coverage](https://camo.githubusercontent.com/5b4c1312ef130e766a29271ecb0cd930c7654dd7112acb9288148205ec41320c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6d69636861656c2d727562656c2f6c61726176656c2d736166652d726571756573742e7376673f7374796c653d666c61742d737175617265266c6f676f3d7363727574696e697a6572)](https://scrutinizer-ci.com/g/michael-rubel/laravel-safe-request/?branch=main)[![GitHub Tests Action Status](https://camo.githubusercontent.com/6ad5a8abbd90bf2fbf1e30426159ae1fc0a38016be002a40ae7cd65d06d19a9b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d69636861656c2d727562656c2f6c61726176656c2d736166652d726571756573742f72756e2d74657374732e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265266c6162656c3d7465737473266c6f676f3d676974687562)](https://github.com/michael-rubel/laravel-safe-request/actions)[![PHPStan](https://camo.githubusercontent.com/6d5f3e7b31b957b78f685d0da87d7e4a47a176875cd0d68eb95aba192511bb7c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d69636861656c2d727562656c2f6c61726176656c2d736166652d726571756573742f7068707374616e2e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265266c6162656c3d6c6172617374616e266c6f676f3d6c61726176656c)](https://github.com/michael-rubel/laravel-safe-request/actions)

Makes your FormRequest keys retrieved from `$request->safe()` method by default to prevent retrieval of unvalidated input values.

---

The package requires `PHP 8` or higher and `Laravel 9` or higher.

\#StandWithUkraine
------------------

[](#standwithukraine)

[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)

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

[](#installation)

Install the package using composer:

```
composer require michael-rubel/laravel-safe-request
```

Usage
-----

[](#usage)

Apply trait for your base Form Request in Laravel:

```
use RetrievesSafeInput;
```

Any value accessed by the magic method (like `$request->key`) now will be retrieved from the `$request->safe()`.

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

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

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~57 days

Total

5

Last Release

1209d ago

Major Versions

1.0.2 → 2.0.02022-12-10

PHP version history (2 changes)1.0.0PHP ^8.0|^8.1

2.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/9c060c69332d50a7cb290529ad84a7f216dec94d59950db7446dc93208787083?d=identicon)[michael-rubel](/maintainers/michael-rubel)

---

Top Contributors

[![michael-rubel](https://avatars.githubusercontent.com/u/37669560?v=4)](https://github.com/michael-rubel "michael-rubel (29 commits)")

---

Tags

laravellooking-for-contributorsphplaravelform-requestmichael-rubellaravel-safe-requestsafe-input

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/michael-rubel-laravel-safe-request/health.svg)

```
[![Health](https://phpackages.com/badges/michael-rubel-laravel-safe-request/health.svg)](https://phpackages.com/packages/michael-rubel-laravel-safe-request)
```

###  Alternatives

[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[ziming/laravel-zxcvbn

Zxcvbn Password validation rule for Laravel

3056.7k](/packages/ziming-laravel-zxcvbn)[laravel-validation-rules/phone

Validate that a phone number is in the correct format

69355.5k](/packages/laravel-validation-rules-phone)[basillangevin/laravel-data-json-schemas

Transforms Spatie Data objects into JSON Schemas with built-in validation

1312.2k1](/packages/basillangevin-laravel-data-json-schemas)[yorcreative/laravel-argonaut-dto

Argonaut is a lightweight Data Transfer Object (DTO) package for Laravel that supports nested casting, recursive serialization, and validation out of the box. Ideal for service layers, APIs, and clean architecture workflows.

1062.8k1](/packages/yorcreative-laravel-argonaut-dto)

PHPackages © 2026

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