在Laravel请求中保留新行

I'm using Laravel to pass a JSON And storing the request into a model The JSON that I'm passing is of the form

{
    "key": "GEnFcIB5UBScbwrM9OfBqYzY0/8=
",
} 

But when storing it to the DB, the key is stored as GEnFcIB5UBScbwrM9OfBqYzY0/8=

This is what I get when I dump the request

  Request {#42
      #json: ParameterBag {#24
        #parameters: array:1 [
          "key" => "GEnFcIB5UBScbwrM9OfBqYzY0/8="
          ]
      }

        ...

      #content: "{"key":"GEnFcIB5UBScbwrM9OfBqYzY0/8=
"}",

        ...

    }

As you can see the #content is showing the " ", but $request->key discards it and eventually is not saved in the DB

Any suggestions?

This might very well be due to trimming.

https://laravel.com/docs/5.6/requests#input-trimming-and-normalization

By default, Laravel includes the TrimStrings and ConvertEmptyStringsToNull middleware in your application's global middleware stack. These middleware are listed in the stack by the App\Http\Kernel class. These middleware will automatically trim all incoming string fields on the request, as well as convert any empty string fields to null. This allows you to not have to worry about these normalization concerns in your routes and controllers.

If you would like to disable this behavior, you may remove the two middleware from your application's middleware stack by removing them from the $middleware property of your App\Http\Kernel class.