title: Laravel 5.4 input empty default value
body: <p>I am learning laravel 5.4. I know there is a new global middleware to convert request input empty string to null. But I have a question, the url like:<code>http://localhost/choosePlan?type=1</code>. I get type filed value in my controller action. If there is no type filed in request input or the value is empty, I want to set default type value to 1. So, in my controller action, I write like this:</p>
  
  <pre><code>$type = $request-&gt;input('type',1);
  </code></pre>
  
  <p>Only I access <code>http://localhost/choosePlan</code> I can get type default value. If I access like <code>http://localhost/choosePlan?type</code> or <code>http://localhost/choosePlan?type=</code> I still get type is null. So I think the default value for input method only works fine if no filed name in request body right? And how can I do to solve above problem? Like determine type is null and then set it to default value 1? I can't disable ConvertEmptyStringsToNull middleware cause it is used somewhere else. Thanks.</p>
  
  <hr>
  
  <p>Update: I just test disable ConvertEmptyStringsToNull middleware now I get type is empty string. Maybe I misunderstand this method, I think the default value is just for specified filed not present in request not for filed name present in request but value is empty, is that right? Oh, my god, this means I also misunderstand it in Laravel 5.2.</p>