title: Laravel - Use default value if input is null
body: <p>In Laravel, if I've set a default value of 0 for all my integers, how can I get it to just go with its default if the request is null?</p>
  
  <p>I've tried: </p>
  
  <pre><code>$property-&gt;bedrooms = $request-&gt;input('bedrooms', 0);
  </code></pre>
  
  <p>But it still just tries to set it as null and throws an error, as I'm assuming that's just for if the value doesn't exist at all. </p>
  
  <p>Of course, I could go:</p>
  
  <pre><code>if($request-&gt;bedrooms){
      $property-&gt;bedrooms = $request-&gt;bedrooms;
  }else{
      $property-&gt;bedrooms = 0;
  }
  </code></pre>
  
  <p>...but that seems rather verbose. </p>
  
  <p>Is there a neater solution I'm missing? Default values are sorta useless if you need to use an if/else every time anyway, surely. </p>