Laravel 5.4 $ request-> get trimming whitespace in input

Laravel trims spaces at the beginning of a line. Example:

" this is a test"

Returns

This is a test

I am using Laravels $request->get('name')

When I use $_POST

laravel in my app, it works fine.

Does anyone know how I can achieve this with $request->get()

+3


source to share


1 answer


In laravel 5.4, Taylor added middleware TrimStrings

to the default staging middleware group. This way you can remove \App\Http\Middleware\TrimStrings::class

from Http\Kernel.php

.



+5


source







All Articles