Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 5.4 $request->get trims whitespace in input

Laravel is trimming whitespace at the beginning of the string. Example:

" this is a test"

Is returning

This is a test

I use Laravels $request->get('name')

When i use $_POST in the laravel application it is working fine.

Does somebody know how i can achive this with $request->get()

like image 523
erwinnandpersad Avatar asked Apr 20 '17 11:04

erwinnandpersad


1 Answers

In laravel 5.4, Taylor added the TrimStrings middleware to default middleware group. So you can remove the \App\Http\Middleware\TrimStrings::class from the Http\Kernel.php.

like image 162
Pankit Gami Avatar answered Nov 14 '22 01:11

Pankit Gami