Created
April 24, 2017 07:58
-
-
Save sirawitpra/7c594a56d3a9fd0a88916b7d63879374 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Illuminate\Foundation\Http\Middleware; | |
class ConvertEmptyStringsToNull extends TransformsRequest | |
{ | |
/** | |
* Transform the given value. | |
* | |
* @param string $key | |
* @param mixed $value | |
* @return mixed | |
*/ | |
protected function transform($key, $value) | |
{ | |
return is_string($value) && $value === '' ? null : $value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment