Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

michael-rubel/laravel-safe-request

Repository files navigation

Safe input by default

Laravel Safe Request

Latest Version on Packagist Total Downloads Code Quality Code Coverage GitHub Tests Action Status PHPStan

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

SWUbanner

Installation

Install the package using composer:

composer require michael-rubel/laravel-safe-request

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

composer test

License

The MIT License (MIT). Please see License File for more information.